1 /* remove( const char * )
3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
7 /* This is an example implementation of remove() fit for use with POSIX kernels.
16 #include "/usr/include/errno.h"
18 extern struct _PDCLIB_file_t * _PDCLIB_filelist;
20 extern int unlink( const char * pathname );
22 int remove( const char * pathname )
25 struct _PDCLIB_file_t * current = _PDCLIB_filelist;
26 while ( current != NULL )
28 if ( ( current->filename != NULL ) && ( strcmp( current->filename, pathname ) == 0 ) )
32 current = current->next;
34 if ( ( rc = unlink( pathname ) ) == -1 )
38 /* See the comments on implementation-defined errno values in
52 _PDCLIB_errno = _PDCLIB_ERROR;
55 /* This should be something like EUNKNOWN. */
56 _PDCLIB_errno = _PDCLIB_ERROR;
67 #include "_PDCLIB_test.h"
71 /* Testing covered by ftell.c (and several others) */