~sircmpwn/ctools

35f7a1b529208f3b6da468d6f73eeca135d8013d — Adrian Perez de Castro 1 year, 4 months ago d5ecc71
Implement link
3 files changed, 20 insertions(+), 1 deletions(-)

M STATUS
M meson.build
A src/link.c
M STATUS => STATUS +1 -1
@@ 70,7 70,7 @@ T       ipcs*
T       join
T       kill
    W   lex
T       link
  D     link
T       ln
T       locale
T       localedef

M meson.build => meson.build +1 -0
@@ 27,6 27,7 @@ oneshots = [
]

xsi_oneshots = [
	'link',
]

cc = meson.get_compiler('c')

A src/link.c => src/link.c +18 -0
@@ 0,0 1,18 @@
#include <stdio.h>
#include <unistd.h>

int
main(int argc, char *argv[])
{
	if (getopt(argc, argv, "") != -1 || optind != argc - 2) {
		fprintf(stderr, "usage: link file1 file2\n");
		return 1;
	}

	if (link(argv[optind], argv[optind + 1]) == -1) {
		perror("link");
		return 1;
	}

	return 0;
}