Add link(1)
This commit is contained in:
parent
1dd2913e33
commit
314885836c
1
Makefile
1
Makefile
@ -57,6 +57,7 @@ SRC = \
|
||||
head.c \
|
||||
hostname.c \
|
||||
kill.c \
|
||||
link.c \
|
||||
ln.c \
|
||||
ls.c \
|
||||
md5sum.c \
|
||||
|
14
link.1
Normal file
14
link.1
Normal file
@ -0,0 +1,14 @@
|
||||
.TH LN 1 sbase\-VERSION
|
||||
.SH NAME
|
||||
link \- create a hard link by calling the link function
|
||||
.SH SYNOPSIS
|
||||
.B link
|
||||
.I target
|
||||
.I linkname
|
||||
.P
|
||||
.SH DESCRIPTION
|
||||
.B link
|
||||
creates a hard link to a given file, with the given name.
|
||||
.SH SEE ALSO
|
||||
.IR ln (1),
|
||||
.IR link (2)
|
17
link.c
Normal file
17
link.c
Normal file
@ -0,0 +1,17 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
argv0 = argv[0];
|
||||
|
||||
if(argc != 3)
|
||||
eprintf("usage: %s target linkname\n", argv0);
|
||||
if (0 != link(argv[1], argv[2]))
|
||||
eprintf("link:");
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user