1 ssize_t InitFile(int dirfd, const char *file, const char *buf, size_t size)
6 fd = openat(dirfd, ".", O_TMPFILE|O_RDWR, S_IRUSR|S_IWUSR);
8 perror("Cannot get temporary filedescritor");
11 written = FullWrite(fd, buf, size);
13 perror("error writing on tmp file");
16 snprintf(path, PATH_MAX, "/proc/self/fd/%d", fd);
17 res = linkat(AT_FDCWD, path, dirfd, file, AT_SYMLINK_FOLLOW);
19 perror("error linking the file");