[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

unlink or kernel error?



Hi all,

Sorry, my problem is probably not Debian specific... I tried to run under
slink with the 2.0.36 kernel the following program:

#define RUN "/tmp/.rem.run"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
main()
{
  open(RUN, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR);
  printf("File created\n");
  sleep(30);
  unlink(RUN);
  printf("File removed\n");
  sleep(30);
  printf("Finish\n");
}

After the message "File created" I can see that there is a file .rem.run
in /tmp directory. After "File removed" that file disappears. But
according to unlink man page it should exist up to the message "Finish"
because it is not closed. Only after terminating the program kernel
closes all open files and .rem.run should be removed. Does anybody have
an idea what's going on here? Thanks!

--
  Tad
 


Reply to: