Lines Matching refs:fd
49 set_cloexec_or_close(int fd)
53 if (fd == -1)
56 flags = fcntl(fd, F_GETFD);
60 if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1)
63 return fd;
66 close(fd);
75 int fd;
78 fd = mkostemp(tmpname, O_CLOEXEC);
80 fd = mkstemp(tmpname);
83 if (fd < 0) {
84 return fd;
88 fd = set_cloexec_or_close(fd);
92 return fd;
117 int fd, ret;
121 fd = memfd_create(debug_name, MFD_CLOEXEC | MFD_ALLOW_SEALING);
125 fd = syscall(SYS_memfd_create, debug_name, MFD_CLOEXEC | MFD_ALLOW_SEALING);
127 fd = shm_open(SHM_ANON, O_CREAT | O_RDWR | O_CLOEXEC, 0600);
130 fd = shm_mkstemp(template);
131 if (fd != -1)
150 fd = create_tmpfile_cloexec(name);
155 if (fd < 0)
158 ret = ftruncate(fd, size);
160 close(fd);
164 return fd;