#define _BSD_SOURCE #include #include #include #include #include #include #include int main(void) { char buf[100]; if (symlink("128.186.254.12", "myfile") < 0) { perror("symlink"); exit(EXIT_FAILURE); } memset(buf, 0, sizeof(buf)); if (readlink("myfile", buf, sizeof(buf)-1) < 0) { perror("readlink"); exit(EXIT_FAILURE); } printf("myfile: %s\n", buf); return(EXIT_SUCCESS); }