From 3886749b1c8d79d4701bf6b8e66249c4e1491648 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Sun, 4 Jan 2026 18:06:31 +0800 Subject: dev(shell): implement basic shell tools fixed(file-system): fixed read and write bugs --- src/user/ln.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/user/ln.cc (limited to 'src/user/ln.cc') diff --git a/src/user/ln.cc b/src/user/ln.cc new file mode 100644 index 0000000..2370fdc --- /dev/null +++ b/src/user/ln.cc @@ -0,0 +1,18 @@ +#include "ulib/stdio.h" +#include "ulib/stdlib.h" +#include "user/user.h" + +int main(int argc, char *argv[]) +{ + if (argc != 3) + { + printf("Usage: ln old new\n"); + exit(1); + } + if (link(argv[1], argv[2]) < 0) + { + printf("link %s %s failed\n", argv[1], argv[2]); + exit(1); + } + exit(0); +} \ No newline at end of file -- cgit v1.2.3