diff options
author | kstailey <kstailey@cvs.openbsd.org> | 1997-06-12 15:22:39 +0000 |
---|---|---|
committer | kstailey <kstailey@cvs.openbsd.org> | 1997-06-12 15:22:39 +0000 |
commit | 3e212b27464f62c3c4ec59a4ddd552ad32408507 (patch) | |
tree | b34b4d24f773029a5a60b9af59302fcbe704131a /usr.bin/readlink/readlink.c | |
parent | 2731dbc5ab5fd444384d13e3bfbce8c9853313e3 (diff) |
goodbye perl
Diffstat (limited to 'usr.bin/readlink/readlink.c')
-rw-r--r-- | usr.bin/readlink/readlink.c | 20 |
1 files changed, 20 insertions, 0 deletions
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); +} |