]> TLD Linux GIT Repositories - rc-scripts.git/blob - src/resolvesymlink.c
- from PLD
[rc-scripts.git] / src / resolvesymlink.c
1 #include <sys/param.h>
2 #include <stdlib.h>
3 #include <stdio.h>
4 #include <unistd.h>
5
6 #ifdef HAVE_CONFIG_H
7 #include "config.h"
8 #endif
9
10 int main(int argc, char ** argv) {
11     char *buf = calloc (MAXPATHLEN+1, sizeof(char));
12     
13     if (argc<1) return 1;
14     (void) readlink (argv[1], buf, MAXPATHLEN);
15     fprintf (stdout, "%s", buf);
16     exit (0);
17     }