Lines Matching refs:fd
55 int fd; in create_tempfile() local
66 fd = memfd_create("sljit", MFD_CLOEXEC); in create_tempfile()
67 if (fd != -1) { in create_tempfile()
68 fchmod(fd, 0); in create_tempfile()
69 return fd; in create_tempfile()
102 fd = open(tmp_name, O_TMPFILE | O_EXCL | O_RDWR | O_NOATIME | O_CLOEXEC, 0); in create_tempfile()
103 if (fd != -1) in create_tempfile()
104 return fd; in create_tempfile()
113 fd = mkostemp(tmp_name, O_CLOEXEC | O_NOATIME); in create_tempfile()
117 fchmod(fd, 0); in create_tempfile()
120 if (fd == -1) in create_tempfile()
124 close(fd); in create_tempfile()
128 return fd; in create_tempfile()
134 int fd; in alloc_chunk() local
136 fd = create_tempfile(); in alloc_chunk()
137 if (fd == -1) in alloc_chunk()
140 if (ftruncate(fd, (off_t)size)) { in alloc_chunk()
141 close(fd); in alloc_chunk()
145 retval = (struct sljit_chunk_header *)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in alloc_chunk()
148 close(fd); in alloc_chunk()
152 retval->executable = mmap(NULL, size, PROT_READ | PROT_EXEC, MAP_SHARED, fd, 0); in alloc_chunk()
156 close(fd); in alloc_chunk()
160 close(fd); in alloc_chunk()