3 /* remove( const char * )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
9 /* This is an example implementation of remove() fit for use with POSIX kernels.
18 #include "/usr/include/errno.h"
20 extern struct _PDCLIB_file_t * _PDCLIB_filelist;
22 extern int unlink( const char * pathname );
24 int remove( const char * pathname )
27 struct _PDCLIB_file_t * current = _PDCLIB_filelist;
28 while ( current != NULL )
30 if ( ( current->filename != NULL ) && ( strcmp( current->filename, pathname ) == 0 ) )
34 current = current->next;
36 if ( ( rc = unlink( pathname ) ) == -1 )
40 /* See the comments on implementation-defined errno values in
54 _PDCLIB_errno = _PDCLIB_ERROR;
57 /* This should be something like EUNKNOWN. */
58 _PDCLIB_errno = _PDCLIB_ERROR;
68 #include <_PDCLIB_test.h>
72 /* Testing covered by ftell.c (and several others) */