Lines Matching defs:fd
46 int r, fd;
48 fd = sys_memfd_create(name, flags);
49 if (fd < 0) {
55 r = ftruncate(fd, sz);
61 return fd;
64 static __u64 mfd_assert_get_seals(int fd)
68 r = fcntl(fd, F_GET_SEALS);
70 printf("GET_SEALS(%d) failed: %m\n", fd);
77 static void mfd_assert_has_seals(int fd, __u64 seals)
81 s = mfd_assert_get_seals(fd);
84 (unsigned long long)seals, (unsigned long long)s, fd);
89 static void mfd_assert_add_seals(int fd, __u64 seals)
94 s = mfd_assert_get_seals(fd);
95 r = fcntl(fd, F_ADD_SEALS, seals);
98 fd, (unsigned long long)s, (unsigned long long)seals);
103 static int mfd_busy_add_seals(int fd, __u64 seals)
108 r = fcntl(fd, F_GET_SEALS);
114 r = fcntl(fd, F_ADD_SEALS, seals);
117 fd, (unsigned long long)s, (unsigned long long)seals);
124 static void *mfd_assert_mmap_shared(int fd)
132 fd,
142 static void *mfd_assert_mmap_private(int fd)
150 fd,
231 int fd, mfd, r;
262 fd = open(argv[1], O_RDONLY | O_CLOEXEC);
263 if (fd < 0) {
285 * If @fd is on the memfd-fake-FUSE-FS, the read() is delayed by 1s.
289 r = read(fd, p, mfd_def_size);
325 close(fd);