master xplshn/aruu / cmd / posix / unlink.c
 1/* See LICENSE file for copyright and license details. */
 2
 3
 4#include <unistd.h>
 5
 6#include "util.h"
 7
 8static void
 9usage(void)
10{
11	eprintf("usage: %s file\n", argv0);
12}
13
14// ?man unlink: remove a file
15// ?man arguments: file
16// ?man call the unlink system call to remove a file
17int
18main(int argc, char *argv[])
19{
20	ARGBEGIN {
21	default:
22		usage();
23	} ARGEND
24
25	if (argc != 1)
26		usage();
27
28	if (unlink(argv[0]) < 0)
29		eprintf("unlink: '%s':", argv[0]);
30
31	return 0;
32}