ewmscp  ..
tmpTest.cpp
Go to the documentation of this file.
1 #include <sys/types.h>
2 #include <sys/stat.h>
3 #include <fcntl.h>
4 #include <string.h>
5 #include <unistd.h>
6 #include <stdio.h>
7 
8 
9 int main(int argc, const char *argv[]) {
10  auto fd = open(argv[1], O_TMPFILE | O_WRONLY, 0777);
11  write(fd, argv[1], strlen(argv[1]));
12  write(fd, argv[2], strlen(argv[2]));
13  char path[1024];
14  snprintf(path, 1024, "/proc/self/fd/%d", fd);
15  linkat(df, "", AT_FDCWD, argv[2], AT_EMPTY_PATH);
16  close(fd);
17 }
main
int main(int argc, const char *argv[])
Definition: tmpTest.cpp:9