Unlink a filename from the file system. If this is the last link (reference) to the file, the file is deleted.
Syntax
#include <unistd.h>
int unlink (const char *path);
Parameters
-
path
The path that will be removed.
Return Value
The return value is null if successful. Otherwise, the return value is negative and errno is set:
-
ENOENT
No such file or directory.
-
ENOSYS
The system call is not supported for this file system, or not implemented.
Remarks
SocketFS, ProcFS, KFS and DevFS does not support unlink
, since these file
systems are read-only from userspace. PipeFS supports unlinking pipes that are
no longer used.