Searched refs:fd (Results 1 - 25 of 273) sorted by relevance

1234567891011

/systemd/src/coredump/
H A Dstacktrace.h22 int coredump_make_stack_trace(int fd, const char *executable, char **ret);
/systemd/src/import/
H A Dqcow2-util.h22 int qcow2_detect(int fd);
H A Dimport-common.h22 int import_make_read_only_fd(int fd);
/systemd/src/basic/
H A Dchattr-util.c27 #include "fd-util.h"
30 int chattr_fd(int fd, unsigned value, unsigned mask) { argument
34 assert(fd >= 0);
36 if (fstat(fd, &st) < 0)
51 if (ioctl(fd, FS_IOC_GETFLAGS, &old_attr) < 0)
58 if (ioctl(fd, FS_IOC_SETFLAGS, &new_attr) < 0)
65 _cleanup_close_ int fd = -1; local
72 fd = open(p, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW);
73 if (fd < 0)
76 return chattr_fd(fd, valu
79 read_attr_fd(int fd, unsigned *ret) argument
97 _cleanup_close_ int fd = -1; local
[all...]
H A Dmemfd-util.c32 #include "fd-util.h"
41 int fd; local
69 fd = memfd_create(name, MFD_ALLOW_SEALING | MFD_CLOEXEC);
70 if (fd < 0)
73 return fd;
76 int memfd_map(int fd, uint64_t offset, size_t size, void **p) { argument
80 assert(fd >= 0);
84 sealed = memfd_get_sealed(fd);
89 q = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, offset);
91 q = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offse
100 memfd_set_sealed(int fd) argument
112 memfd_get_sealed(int fd) argument
124 memfd_get_size(int fd, uint64_t *sz) argument
139 memfd_set_size(int fd, uint64_t sz) argument
152 _cleanup_close_ int fd = -1; local
[all...]
H A Dchattr-util.h22 int chattr_fd(int fd, unsigned value, unsigned mask);
25 int read_attr_fd(int fd, unsigned *ret);
H A Dmemfd-util.h30 int memfd_map(int fd, uint64_t offset, size_t size, void **p);
32 int memfd_set_sealed(int fd);
33 int memfd_get_sealed(int fd);
35 int memfd_get_size(int fd, uint64_t *sz);
36 int memfd_set_size(int fd, uint64_t sz);
H A Dasync.h25 int asynchronous_close(int fd);
H A Dbtrfs-util.h59 int btrfs_is_filesystem(int fd);
61 int btrfs_is_subvol_fd(int fd);
67 int btrfs_get_block_device_fd(int fd, dev_t *dev);
70 int btrfs_defrag_fd(int fd);
73 int btrfs_quota_enable_fd(int fd, bool b);
76 int btrfs_quota_scan_start(int fd);
77 int btrfs_quota_scan_wait(int fd);
78 int btrfs_quota_scan_ongoing(int fd);
80 int btrfs_resize_loopback_fd(int fd, uint64_t size, bool grow_only);
90 int btrfs_subvol_remove_fd(int fd, cons
[all...]
H A Dio-util.c30 int flush_fd(int fd) { argument
32 .fd = fd,
51 l = read(fd, buf, sizeof(buf));
66 ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll) { argument
70 assert(fd >= 0);
82 k = read(fd, p, nbytes);
93 (void) fd_wait_for_event(fd, POLLIN, USEC_INFINITY);
113 int loop_read_exact(int fd, void *buf, size_t nbytes, bool do_poll) { argument
116 n = loop_read(fd, bu
125 loop_write(int fd, const void *buf, size_t nbytes, bool do_poll) argument
166 pipe_eof(int fd) argument
184 fd_wait_for_event(int fd, int event, usec_t t) argument
219 sparse_write(int fd, const void *p, size_t sz, size_t run_length) argument
[all...]
H A Dlockfile-util.c28 #include "fd-util.h"
35 _cleanup_close_ int fd = -1; local
61 fd = open(p, O_CREAT|O_RDWR|O_NOFOLLOW|O_CLOEXEC|O_NOCTTY, 0600);
62 if (fd < 0)
65 r = fcntl(fd, (operation & LOCK_NB) ? F_OFD_SETLK : F_OFD_SETLKW, &fl);
70 r = flock(fd, operation);
82 r = fstat(fd, &st);
88 fd = safe_close(fd);
92 ret->fd
[all...]
H A Dfdset.h33 int fdset_put(FDSet *s, int fd);
34 int fdset_put_dup(FDSet *s, int fd);
35 int fdset_consume(FDSet *s, int fd);
37 bool fdset_contains(FDSet *s, int fd);
38 int fdset_remove(FDSet *s, int fd);
55 #define FDSET_FOREACH(fd, fds, i) \
56 for ((i) = ITERATOR_FIRST, (fd) = fdset_iterate((fds), &(i)); (fd) >= 0; (fd) = fdset_iterate((fds), &(i)))
H A Dsocket-label.c31 #include "fd-util.h"
52 _cleanup_close_ int fd = -1; local
70 fd = socket(socket_address_family(a), a->type | flags, a->protocol);
71 r = fd < 0 ? -errno : 0;
82 if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &flag, sizeof(flag)) < 0)
88 if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, bind_to_device, strlen(bind_to_device)+1) < 0)
93 if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one)) < 0)
99 if (setsockopt(fd, IPPROTO_IP, IP_FREEBIND, &one, sizeof(one)) < 0)
105 if (setsockopt(fd, IPPROTO_IP, IP_TRANSPARENT, &one, sizeof(one)) < 0)
111 if (setsockopt(fd, SOL_SOCKE
150 int fd, r; local
[all...]
H A Dfd-util.h29 /* Make sure we can distinguish fd 0 and NULL */
30 #define FD_TO_PTR(fd) INT_TO_PTR((fd)+1)
33 int close_nointr(int fd);
34 int safe_close(int fd);
43 static inline void closep(int *fd) { argument
44 safe_close(*fd);
64 int fd_nonblock(int fd, bool nonblock);
65 int fd_cloexec(int fd, bool cloexec);
H A Dlockfile-util.h29 int fd; member in struct:LockFile
39 #define LOCK_FILE_INIT { .fd = -1, .path = NULL }
H A Dbtrfs-util.c42 #include "fd-util.h"
56 /* WARNING: Be careful with file system ioctls! When we get an fd, we
77 int fd; local
85 fd = open(parent, flags);
86 if (fd < 0)
89 return fd;
109 int btrfs_is_filesystem(int fd) { argument
112 assert(fd >= 0);
114 if (fstatfs(fd, &sfs) < 0)
120 int btrfs_is_subvol_fd(int fd) { argument
137 _cleanup_close_ int fd = -1; local
150 _cleanup_close_ int fd = -1; local
190 btrfs_subvol_set_read_only_fd(int fd, bool b) argument
220 _cleanup_close_ int fd = -1; local
229 btrfs_subvol_get_read_only_fd(int fd) argument
297 btrfs_get_block_device_fd(int fd, dev_t *dev) argument
348 _cleanup_close_ int fd = -1; local
360 btrfs_subvol_get_id_fd(int fd, uint64_t *ret) argument
382 btrfs_subvol_get_id(int fd, const char *subvol, uint64_t *ret) argument
466 btrfs_subvol_get_info_fd(int fd, uint64_t subvol_id, BtrfsSubvolInfo *ret) argument
558 btrfs_qgroup_get_quota_fd(int fd, uint64_t qgroupid, BtrfsQuotaInfo *ret) argument
673 _cleanup_close_ int fd = -1; local
682 btrfs_subvol_find_subtree_qgroup(int fd, uint64_t subvol_id, uint64_t *ret) argument
744 btrfs_subvol_get_subtree_quota_fd(int fd, uint64_t subvol_id, BtrfsQuotaInfo *ret) argument
766 _cleanup_close_ int fd = -1; local
775 btrfs_defrag_fd(int fd) argument
793 _cleanup_close_ int fd = -1; local
802 btrfs_quota_enable_fd(int fd, bool b) argument
823 _cleanup_close_ int fd = -1; local
832 btrfs_qgroup_set_limit_fd(int fd, uint64_t qgroupid, uint64_t referenced_max) argument
875 _cleanup_close_ int fd = -1; local
884 btrfs_subvol_set_subtree_quota_limit_fd(int fd, uint64_t subvol_id, uint64_t referenced_max) argument
898 _cleanup_close_ int fd = -1; local
907 btrfs_resize_loopback_fd(int fd, uint64_t new_size, bool grow_only) argument
989 _cleanup_close_ int fd = -1; local
1023 qgroup_create_or_destroy(int fd, bool b, uint64_t qgroupid) argument
1059 btrfs_qgroup_create(int fd, uint64_t qgroupid) argument
1063 btrfs_qgroup_destroy(int fd, uint64_t qgroupid) argument
1067 btrfs_qgroup_destroy_recursive(int fd, uint64_t qgroupid) argument
1108 btrfs_quota_scan_start(int fd) argument
1119 btrfs_quota_scan_wait(int fd) argument
1128 btrfs_quota_scan_ongoing(int fd) argument
1139 qgroup_assign_or_unassign(int fd, bool b, uint64_t child, uint64_t parent) argument
1175 btrfs_qgroup_assign(int fd, uint64_t child, uint64_t parent) argument
1179 btrfs_qgroup_unassign(int fd, uint64_t child, uint64_t parent) argument
1183 subvol_remove_children(int fd, const char *subvolume, uint64_t subvol_id, BtrfsRemoveFlags flags) argument
1317 _cleanup_close_ int fd = -1; local
1334 btrfs_subvol_remove_fd(int fd, const char *subvolume, BtrfsRemoveFlags flags) argument
1338 btrfs_qgroup_copy_limits(int fd, uint64_t old_qgroupid, uint64_t new_qgroupid) argument
1438 copy_quota_hierarchy(int fd, uint64_t old_subvol_id, uint64_t new_subvol_id) argument
1498 copy_subtree_quota_limits(int fd, uint64_t old_subvol, uint64_t new_subvol) argument
1769 btrfs_qgroup_find_parents(int fd, uint64_t qgroupid, uint64_t **ret) argument
1857 btrfs_subvol_auto_qgroup_fd(int fd, uint64_t subvol_id, bool insert_intermediary_qgroup) argument
2006 _cleanup_close_ int fd = -1; local
2015 btrfs_subvol_get_parent(int fd, uint64_t subvol_id, uint64_t *ret) argument
[all...]
/systemd/src/test/
H A Dtest-async.c36 int fd; local
39 fd = mkostemp_safe(name, O_RDWR|O_CLOEXEC);
40 assert_se(fd >= 0);
41 asynchronous_close(fd);
49 assert_se(fcntl(fd, F_GETFD) == -1);
H A Dtest-fdset.c23 #include "fd-util.h"
30 int fd = -1; local
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; local
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);
62 int fd = -1; local
88 int fd = -1; local
112 _cleanup_close_ int fd = -1; local
132 int fd = -1; local
160 int fd; local
178 int fd; local
[all...]
H A Dtest-tmpfiles.c26 #include "fd-util.h"
37 _cleanup_close_ int fd, fd2; local
43 fd = open_tmpfile(p, O_RDWR|O_CLOEXEC);
44 assert_se(fd >= 0);
46 assert_se(asprintf(&cmd, "ls -l /proc/"PID_FMT"/fd/%d", getpid(), fd) > 0);
53 assert_se(fd >= 0);
56 assert_se(asprintf(&cmd2, "ls -l /proc/"PID_FMT"/fd/%d", getpid(), fd2) > 0);
/systemd/test/mocks/
H A Dfsck2 fd=0
8 fd=$OPTARG
24 echo "$pass $current $maxprogress $device">&$fd
/systemd/src/libudev/
H A Dlibudev-queue.c28 #include "fd-util.h"
47 int fd; member in struct:udev_queue
72 udev_queue->fd = -1;
111 safe_close(udev_queue->fd);
236 int fd; local
239 if (udev_queue->fd >= 0)
240 return udev_queue->fd;
242 fd = inotify_init1(IN_CLOEXEC);
243 if (fd < 0)
246 r = inotify_add_watch(fd, "/ru
[all...]
/systemd/src/systemd/
H A Dsd-daemon.h57 /* The first passed file descriptor is fd 3 */
89 int sd_is_fifo(int fd, const char *path);
101 int sd_is_special(int fd, const char *path);
117 int sd_is_socket(int fd, int family, int type, int listening);
131 int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port);
147 int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length);
157 int sd_is_mq(int fd, const char *path);
252 Similar to sd_pid_notify(), but also passes the specified fd array
/systemd/src/core/
H A Dmachine-id-setup.c31 #include "fd-util.h"
76 static int read_machine_id(int fd, char id[34]) { argument
80 assert(fd >= 0);
86 r = loop_read_exact(fd, id_to_validate, 33, false);
104 static int write_machine_id(int fd, char id[34]) { argument
105 assert(fd >= 0);
108 if (lseek(fd, 0, SEEK_SET) < 0)
111 return loop_write(fd, id, 33, false);
115 int fd, r; local
129 fd
201 _cleanup_close_ int fd = -1; local
299 _cleanup_close_ int fd = -1, initial_mntns_fd = -1; local
[all...]
/systemd/src/libsystemd-network/
H A Darp-util.h29 int arp_send_probe(int fd, int ifindex,
31 int arp_send_announcement(int fd, int ifindex,
/systemd/src/journal-remote/
H A Djournal-remote.c40 #include "fd-util.h"
86 int fd[2]; local
90 if (pipe(fd) < 0)
98 safe_close_pair(fd);
108 r = dup2(fd[1], STDOUT_FILENO);
114 safe_close_pair(fd);
130 r = close(fd[1]);
134 return fd[0];
291 int fd,
299 int fd,
307 get_source_for_fd(RemoteServer *s, int fd, char *name, RemoteSource **source) argument
339 remove_source(RemoteServer *s, int fd) argument
356 add_source(RemoteServer *s, int fd, char* name, bool own_name) argument
417 add_raw_socket(RemoteServer *s, int fd) argument
442 int fd; local
455 request_meta(void **connection_cls, int fd, char *hostname) argument
568 int r, code, fd; local
637 setup_microhttpd_server(RemoteServer *s, int fd, const char *key, const char *cert, const char *trust) argument
760 int fd; local
769 dispatch_http_event(sd_event_source *event, int fd, uint32_t revents, void *userdata) argument
813 int fd, r; local
829 int r, n, fd; local
1029 handle_raw_source(sd_event_source *event, int fd, uint32_t revents, RemoteServer *s) argument
1089 dispatch_raw_source_event(sd_event_source *event, int fd, uint32_t revents, void *userdata) argument
1115 accept_connection(const char* type, int fd, SocketAddress *addr, char **hostname) argument
1162 dispatch_raw_connection_event(sd_event_source *event, int fd, uint32_t revents, void *userdata) argument
[all...]

Completed in 6846 milliseconds

1234567891011