Back to index

glibc  2.9
Functions
remove.c File Reference
#include <errno.h>
#include <stdio.h>
#include <unistd.h>

Go to the source code of this file.

Functions

int remove (char *file) const

Function Documentation

int remove ( char *  file) const

Definition at line 25 of file remove.c.

{
  /* First try to unlink since this is more frequently the necessary action. */
  if (__unlink (file) != 0
      /* If it is indeed a directory...  */
      && (errno != EISDIR
         /* ...try to remove it.  */
         || __rmdir (file) != 0))
    /* Cannot remove the object for whatever reason.  */
    return -1;

  return 0;
}

Here is the call graph for this function: