Add link(1)

This commit is contained in:
Markus Teich 2014-10-17 15:32:08 +01:00 committed by sin
parent 1dd2913e33
commit 314885836c
5 changed files with 33 additions and 1 deletions

View File

@ -57,6 +57,7 @@ SRC = \
head.c \
hostname.c \
kill.c \
link.c \
ln.c \
ls.c \
md5sum.c \

1
README
View File

@ -34,6 +34,7 @@ grep
head
hostname
kill
link
ln
ls
md5sum

1
TODO
View File

@ -12,7 +12,6 @@ file
find
getconf
join
link
logger
logname
od

14
link.1 Normal file
View 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
View 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;
}