Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 39) sorted by relevance

12

/support/
A Dsupport_descriptor_supports_holes.c44 xfstat (fd, &st); in support_descriptor_supports_holes()
55 xlseek (fd, 0, SEEK_SET); in support_descriptor_supports_holes()
57 xwrite (fd, &b, 1); in support_descriptor_supports_holes()
59 TEST_COMPARE (fsync (fd), 0); in support_descriptor_supports_holes()
60 xfstat (fd, &st); in support_descriptor_supports_holes()
71 xwrite (fd, &b, 1); in support_descriptor_supports_holes()
73 TEST_COMPARE (fsync (fd), 0); in support_descriptor_supports_holes()
74 xfstat (fd, &st); in support_descriptor_supports_holes()
81 xfstat (fd, &st); in support_descriptor_supports_holes()
85 xftruncate (fd, 0); in support_descriptor_supports_holes()
[all …]
A Dsupport_become_root.c35 int fd = open64 ("/proc/self/uid_map", O_WRONLY); in setup_uid_gid_mapping() local
36 if (fd < 0) in setup_uid_gid_mapping()
51 xwrite (fd, buf, ret); in setup_uid_gid_mapping()
52 xclose (fd); in setup_uid_gid_mapping()
56 fd = open64 ("/proc/self/setgroups", O_WRONLY, 0); in setup_uid_gid_mapping()
57 if (fd < 0) in setup_uid_gid_mapping()
66 xwrite (fd, "deny\n", strlen ("deny\n")); in setup_uid_gid_mapping()
67 xclose (fd); in setup_uid_gid_mapping()
71 fd = xopen ("/proc/self/gid_map", O_WRONLY, 0); in setup_uid_gid_mapping()
76 xwrite (fd, buf, ret); in setup_uid_gid_mapping()
[all …]
A Dignore_stderr.c29 int fd = open (_PATH_DEVNULL, O_WRONLY); in ignore_stderr() local
30 if (fd == -1) in ignore_stderr()
34 dup2 (fd, STDERR_FILENO); in ignore_stderr()
35 close (fd); in ignore_stderr()
A Dxclose.c24 xclose (int fd) in xclose() argument
26 if (close (fd) < 0 && errno != EINTR) in xclose()
27 FAIL_EXIT1 ("close of descriptor %d failed: %m", fd); in xclose()
A Dxlisten.c26 xlisten (int fd, int backlog) in xlisten() argument
28 if (listen (fd, backlog) != 0) in xlisten()
29 FAIL_EXIT1 ("listen (%d, %d): %m", fd, backlog); in xlisten()
A Dxftruncate.c23 xftruncate (int fd, long long length) in xftruncate() argument
25 if (ftruncate64 (fd, length) != 0) in xftruncate()
26 FAIL_EXIT1 ("ftruncate64 (%d, %lld): %m", fd, length); in xftruncate()
A Dsupport-xfstat.c24 xfstat (int fd, struct stat64 *result) in xfstat() argument
26 if (fstat64 (fd, result) != 0) in xfstat()
27 FAIL_EXIT1 ("fstat64 (%d): %m", fd); in xfstat()
A Dxfchmod.c24 xfchmod (int fd, mode_t mode) in xfchmod() argument
26 if (fchmod (fd, mode) != 0) in xfchmod()
27 FAIL_EXIT1 ("fchmod (%d, 0%o): %m", fd, mode); in xfchmod()
A Dsupport-xfstat-time64.c27 xfstat_time64 (int fd, struct __stat64_t64 *result) in xfstat_time64() argument
29 if (__fstat64_time64 (fd, result) != 0) in xfstat_time64()
30 FAIL_EXIT1 ("__fstat64_time64 (%d): %m", fd); in xfstat_time64()
A Dxgetsockname.c26 xgetsockname (int fd, struct sockaddr *sa, socklen_t *plen) in xgetsockname() argument
28 if (getsockname (fd, sa, plen) != 0) in xgetsockname()
29 FAIL_EXIT1 ("setsockopt (%d): %m", fd); in xgetsockname()
A Dxbind.c26 xbind (int fd, const struct sockaddr *sa, socklen_t sa_len) in xbind() argument
28 if (bind (fd, sa, sa_len) != 0) in xbind()
29 FAIL_EXIT1 ("bind (%d), family %d: %m", fd, sa->sa_family); in xbind()
A Dxconnect.c26 xconnect (int fd, const struct sockaddr *sa, socklen_t sa_len) in xconnect() argument
28 if (connect (fd, sa, sa_len) != 0) in xconnect()
29 FAIL_EXIT1 ("connect (%d), family %d: %m", fd, sa->sa_family); in xconnect()
A Dxlseek.c23 xlseek (int fd, long long offset, int whence) in xlseek() argument
25 long long result = lseek64 (fd, offset, whence); in xlseek()
27 FAIL_EXIT1 ("lseek64 (%d, %lld, %d): %m", fd, offset, whence); in xlseek()
A Dxaccept.c26 xaccept (int fd, struct sockaddr *sa, socklen_t *salen) in xaccept() argument
28 int clientfd = accept (fd, sa, salen); in xaccept()
30 FAIL_EXIT1 ("accept (%d): %m", fd); in xaccept()
A Dxsocket.c28 int fd = socket (domain, type, protocol); in xsocket() local
29 if (fd < 0) in xsocket()
31 return fd; in xsocket()
A Dxaccept4.c26 xaccept4 (int fd, struct sockaddr *sa, socklen_t *salen, int flags) in xaccept4() argument
28 int clientfd = accept4 (fd, sa, salen, flags); in xaccept4()
30 FAIL_EXIT1 ("accept4 (%d, 0x%x): %m", fd, flags); in xaccept4()
A Dxsendto.c26 xsendto (int fd, const void *buf, size_t buflen, int flags, in xsendto() argument
29 ssize_t ret = sendto (fd, buf, buflen, flags, sa, salen); in xsendto()
32 fd, buflen, sa->sa_family); in xsendto()
34 FAIL_EXIT1 ("sendto (%d) sent %zd bytes instead of %zu", fd, ret, buflen); in xsendto()
A Dxsetsockopt.c26 xsetsockopt (int fd, int level, int name, const void *val, socklen_t vallen) in xsetsockopt() argument
28 if (setsockopt (fd, level, name, val, vallen) != 0) in xsetsockopt()
30 fd, level, name, (size_t) vallen); in xsetsockopt()
A Dsupport-open-dev-null-range.c43 int fd = open64 ("/dev/null", flags, mode); in open_dev_null() local
44 if (fd >= 0) in open_dev_null()
45 return fd; in open_dev_null()
47 if (fd < 0 && errno != EMFILE) in open_dev_null()
96 for (int fd = minfd; fd < maxfd; fd++) in range_close() local
97 xclose (fd); in range_close()
117 int fd = open_dev_null (flags, mode); in support_open_dev_null_range() local
118 if (fd != lowfd + i) in support_open_dev_null_range()
122 prevfd = lowfd = fd; in support_open_dev_null_range()
125 prevfd = fd; in support_open_dev_null_range()
A Dtst-support_descriptors.c37 TEST_COMPARE (fd, free_descriptor); in subprocess_no_change()
38 xclose (fd); in subprocess_no_change()
46 TEST_COMPARE (fd, free_descriptor); in subprocess_closed_descriptor()
48 xclose (fd); in subprocess_closed_descriptor()
59 TEST_COMPARE (fd, free_descriptor); in subprocess_opened_descriptor()
69 TEST_COMPARE (fd, free_descriptor); in subprocess_changed_descriptor()
71 xclose (fd); in subprocess_changed_descriptor()
178 TEST_COMPARE (fd, free_descriptor); in do_test()
179 sentinel_fd = dup (fd); in do_test()
180 TEST_VERIFY_EXIT (sentinel_fd > fd); in do_test()
[all …]
A Dsupport_descriptors.c32 int fd; member
45 return left->fd - right->fd; in descriptor_compare()
86 if (*endptr != '\0' || fd < 0 || fd > INT_MAX) in support_descriptors_list()
92 if (fd == dirfd (fds)) in support_descriptors_list()
102 if (fstat64 (fd, &st) != 0) in support_descriptors_list()
108 item->fd = fd; in support_descriptors_list()
209 if (left->fd == right->fd) in support_descriptors_check()
228 left->fd, in support_descriptors_check()
239 left->fd, in support_descriptors_check()
245 else if (left->fd < right->fd) in support_descriptors_check()
[all …]
A Dxrecvfrom.c26 xrecvfrom (int fd, void *buf, size_t buflen, int flags, in xrecvfrom() argument
29 ssize_t ret = recvfrom (fd, buf, buflen, flags, sa, salen); in xrecvfrom()
31 FAIL_EXIT1 ("error: recvfrom (%d), %zu bytes buffer: %m", fd, buflen); in xrecvfrom()
A Dxposix_spawn_file_actions_addclose.c23 xposix_spawn_file_actions_addclose (posix_spawn_file_actions_t *fa, int fd) in xposix_spawn_file_actions_addclose() argument
25 int status = posix_spawn_file_actions_addclose (fa, fd); in xposix_spawn_file_actions_addclose()
A Dsupport_enter_network_namespace.c47 int fd = xsocket (AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC, 0); in support_enter_network_namespace() local
50 TEST_VERIFY_EXIT (ioctl (fd, SIOCGIFFLAGS, &req) == 0); in support_enter_network_namespace()
60 TEST_VERIFY_EXIT (ioctl (fd, SIOCSIFFLAGS, &req) == 0); in support_enter_network_namespace()
62 xclose (fd); in support_enter_network_namespace()
A Dxposix_spawn_file_actions_adddup2.c23 xposix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *fa, int fd, in xposix_spawn_file_actions_adddup2() argument
26 int status = posix_spawn_file_actions_adddup2 (fa, fd, newfd); in xposix_spawn_file_actions_adddup2()

Completed in 30 milliseconds

12