File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,10 @@ _rm : rm.o $(ULIB)
105
105
$(LD ) -N -e main -Ttext 0 -o _rm rm.o $(ULIB )
106
106
$(OBJDUMP ) -S _rm > rm.asm
107
107
108
+ _ln : ln.o $(ULIB )
109
+ $(LD ) -N -e main -Ttext 0 -o _ln ln.o $(ULIB )
110
+ $(OBJDUMP ) -S _ln > ln.asm
111
+
108
112
_sh : sh.o $(ULIB )
109
113
$(LD ) -N -e main -Ttext 0 -o _sh sh.o $(ULIB )
110
114
$(OBJDUMP ) -S _sh > sh.asm
@@ -116,7 +120,7 @@ _zombie: zombie.o $(ULIB)
116
120
mkfs : mkfs.c fs.h
117
121
cc -o mkfs mkfs.c
118
122
119
- UPROGS =usertests _echo _cat _init _kill _ls _mkdir _rm _sh _zombie
123
+ UPROGS =usertests _echo _cat _init _kill _ln _ls _mkdir _rm _sh _zombie
120
124
fs.img : mkfs README $(UPROGS )
121
125
./mkfs fs.img README $(UPROGS )
122
126
Original file line number Diff line number Diff line change
1
+ #include "types.h"
2
+ #include "stat.h"
3
+ #include "user.h"
4
+
5
+ int
6
+ main (int argc , char * argv [])
7
+ {
8
+ if (argc != 3 ){
9
+ printf (2 , "Usage: ln old new\n" );
10
+ exit ();
11
+ }
12
+ if (link (argv [1 ], argv [2 ]) < 0 )
13
+ printf (2 , "link %s %s: failed\n" , argv [1 ], argv [2 ]);
14
+ exit ();
15
+ }
You can’t perform that action at this time.
0 commit comments