Created
January 15, 2020 22:43
-
-
Save shakalaca/fca3088b8c8103a4da5529b893eedd99 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dirent.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
int main() { | |
DIR* dir = opendir("."); | |
int ret = 0; | |
char buf[4096]; | |
symlink("/root/v86d", "test"); | |
ret = readlinkat(dirfd(dir), "test", buf, sizeof(buf)); | |
printf("ret: %d\n", ret); | |
unlink("test"); | |
closedir(dir); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment