~sircmpwn/ctools

ref: bb5007143abfc22d947c422bfade941e2a741c8c ctools/src/link.c -rw-r--r-- 296 bytes
bb500714Drew DeVault link: add conformance test 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
}