2020-12-12 06:33:20 +00:00
|
|
|
#define _XOPEN_SOUCE 700
|
|
|
|
|
2020-12-02 02:31:58 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
int main(int argc, char * argv[]) {
|
2022-10-09 16:35:42 +00:00
|
|
|
/*
|
|
|
|
link(3) takes 2 arguments, no more, no less.
|
|
|
|
*/
|
2020-12-02 02:31:58 +00:00
|
|
|
if(argc < 3) {
|
|
|
|
fprintf(stderr, "%s: missing file operand\n", argv[0]);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(argc > 3) {
|
|
|
|
fprintf(stderr, "%s: extra operand specified\n", argv[0]);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2022-10-09 16:35:42 +00:00
|
|
|
/* Yep, this just calls link(3) */
|
2020-12-02 02:31:58 +00:00
|
|
|
return link(argv[1], argv[2]);
|
|
|
|
}
|