Lines Matching refs:fd

23 #include "fd-util.h"
30 int fd = -1;
34 fd = mkostemp_safe(name, O_RDWR|O_CLOEXEC);
35 assert_se(fd >= 0);
37 assert_se(fdset_contains(fdset, fd));
43 _cleanup_close_ int fd = -1;
48 fd = mkostemp_safe(name, O_RDWR|O_CLOEXEC);
49 assert_se(fd >= 0);
53 copyfd = fdset_put_dup(fdset, fd);
54 assert_se(copyfd >= 0 && copyfd != fd);
56 assert_se(!fdset_contains(fdset, fd));
62 int fd = -1;
67 fd = mkostemp_safe(name, O_RDWR|O_CLOEXEC);
68 assert_se(fd >= 0);
72 assert_se(fdset_put(fdset, fd));
75 flags = fcntl(fd, F_GETFD);
80 flags = fcntl(fd, F_GETFD);
88 int fd = -1;
94 fd = mkostemp_safe(name, O_RDWR|O_CLOEXEC);
95 assert_se(fd >= 0);
99 copyfd = fdset_put_dup(fdset, fd);
103 flags = fcntl(fd, F_GETFD);
112 _cleanup_close_ int fd = -1;
116 fd = mkostemp_safe(name, O_RDWR|O_CLOEXEC);
117 assert_se(fd >= 0);
121 assert_se(fdset_put(fdset, fd) >= 0);
122 assert_se(fdset_remove(fdset, fd) >= 0);
123 assert_se(!fdset_contains(fdset, fd));
126 assert_se(fcntl(fd, F_GETFD) >= 0);
132 int fd = -1;
139 fd = mkostemp_safe(name, O_RDWR|O_CLOEXEC);
140 assert_se(fd >= 0);
144 assert_se(fdset_put(fdset, fd) >= 0);
145 assert_se(fdset_put(fdset, fd) >= 0);
146 assert_se(fdset_put(fdset, fd) >= 0);
150 assert_se(a == fd);
160 int fd;
164 fd = mkostemp_safe(name, O_RDWR|O_CLOEXEC);
165 assert_se(fd >= 0);
171 assert_se(fdset_put(fdset, fd) >= 0);
178 int fd;
182 fd = mkostemp_safe(name, O_RDWR|O_CLOEXEC);
183 assert_se(fd >= 0);
189 assert_se(fdset_put(fdset, fd) >= 0);
190 assert_se(fdset_steal_first(fdset) == fd);
192 assert_se(fdset_put(fdset, fd) >= 0);