#include #include #include #include #include #define DIR "inc" #define FNAME DIR "/test.h" int main() { int fd, retval; retval = mkdir (DIR, 0700); if (retval < 0) { perror ("Warning: mkdir"); } fd = open (FNAME, O_RDWR|O_CREAT, 0600); if (fd < 0) { perror ("FATAL: open"); exit (1); } retval = unlink (FNAME); if (retval < 0) { perror ("FATAL: unlink"); exit (2); } /* if this close(2) is uncommented, it works OK even on vfat/umsdos */ /* close(fd); */ retval = rmdir (DIR); if (retval < 0) { perror ("FATAL: rmdir"); exit (3); } fprintf (stderr, "All passed OK\n"); exit (0); }