xv6-riscv-kernel/user/ln.c
Frans Kaashoek 7e6c37e67e Support exit status for exit/wait
One test case for returning a exit status
Passes usertests, but haven't used it to simplify tests
2019-09-10 12:30:10 -04:00

15 lines
288 B
C

#include "kernel/types.h"
#include "kernel/stat.h"
#include "user/user.h"
int
main(int argc, char *argv[])
{
if(argc != 3){
fprintf(2, "Usage: ln old new\n");
exit(-1);
}
if(link(argv[1], argv[2]) < 0)
fprintf(2, "link %s %s: failed\n", argv[1], argv[2]);
exit(0);
}