diff options
author | kstailey <kstailey@openbsd.org> | 1997-06-12 15:22:37 +0000 |
---|---|---|
committer | kstailey <kstailey@openbsd.org> | 1997-06-12 15:22:37 +0000 |
commit | 420a6d2ec44a918635e0a9507531502ebb76c7c5 (patch) | |
tree | fcfe5ca777c23ebb3b190291feec5926d51e26b6 /usr.bin/readlink | |
parent | make bsd.lib.mk a bit more consistant about the lies it echo's (diff) | |
download | wireguard-openbsd-420a6d2ec44a918635e0a9507531502ebb76c7c5.tar.xz wireguard-openbsd-420a6d2ec44a918635e0a9507531502ebb76c7c5.zip |
goodbye perl
Diffstat (limited to 'usr.bin/readlink')
-rw-r--r-- | usr.bin/readlink/Makefile | 6 | ||||
-rw-r--r-- | usr.bin/readlink/readlink.c | 20 |
2 files changed, 26 insertions, 0 deletions
diff --git a/usr.bin/readlink/Makefile b/usr.bin/readlink/Makefile new file mode 100644 index 00000000000..1062c978fc1 --- /dev/null +++ b/usr.bin/readlink/Makefile @@ -0,0 +1,6 @@ +# $OpenBSD: Makefile,v 1.1 1997/06/12 15:22:37 kstailey Exp $ + +PROG= readlink +NOMAN= + +.include <bsd.prog.mk> diff --git a/usr.bin/readlink/readlink.c b/usr.bin/readlink/readlink.c new file mode 100644 index 00000000000..da5cbb5ebc2 --- /dev/null +++ b/usr.bin/readlink/readlink.c @@ -0,0 +1,20 @@ +#include <sys/syslimits.h> +#include <stdio.h> +#include <unistd.h> + +int +main(argc, argv) +int argc; +char **argv; +{ + char buf[PATH_MAX]; + + if (argc != 2) + errx(1, "usage: readlink symlink"); + + if (readlink(argv[1], buf, PATH_MAX) < 0) + exit(1); + else + printf("%s", buf); + exit(0); +} |