/systemd-251/src/shared/ |
D | fdset.h | 21 int fdset_new_array(FDSet **ret, const int *fds, size_t n_fds); 25 int fdset_cloexec(FDSet *fds, bool b); 27 int fdset_close_others(FDSet *fds); 29 unsigned fdset_size(FDSet *fds); 30 bool fdset_isempty(FDSet *fds); 34 int fdset_steal_first(FDSet *fds); 36 void fdset_close(FDSet *fds); 38 #define _FDSET_FOREACH(fd, fds, i) \ argument 39 for (Iterator i = ITERATOR_FIRST; ((fd) = fdset_iterate((fds), &i)) >= 0; ) 40 #define FDSET_FOREACH(fd, fds) \ argument [all …]
|
D | fdset.c | 26 int fdset_new_array(FDSet **ret, const int *fds, size_t n_fds) { in fdset_new_array() argument 39 r = fdset_put(s, fds[i]); in fdset_new_array() 162 int fdset_cloexec(FDSet *fds, bool b) { in fdset_cloexec() argument 166 assert(fds); in fdset_cloexec() 168 SET_FOREACH(p, MAKE_SET(fds)) { in fdset_cloexec() 208 int fdset_close_others(FDSet *fds) { in fdset_close_others() argument 213 m = fdset_size(fds); in fdset_close_others() 217 SET_FOREACH(e, MAKE_SET(fds)) in fdset_close_others() 226 unsigned fdset_size(FDSet *fds) { in fdset_size() argument 227 return set_size(MAKE_SET(fds)); in fdset_size() [all …]
|
D | bpf-program.h | 50 int bpf_program_serialize_attachment(FILE *f, FDSet *fds, const char *key, BPFProgram *p); 51 int bpf_program_serialize_attachment_set(FILE *f, FDSet *fds, const char *key, Set *set); 52 int bpf_program_deserialize_attachment(const char *v, FDSet *fds, BPFProgram **bpfp); 53 int bpf_program_deserialize_attachment_set(const char *v, FDSet *fds, Set **bpfsetp);
|
D | bpf-program.c | 365 FDSet *fds, in bpf_program_serialize_attachment() argument 381 copy = fdset_put_dup(fds, p->kernel_fd); in bpf_program_serialize_attachment() 407 int bpf_program_serialize_attachment_set(FILE *f, FDSet *fds, const char *key, Set *set) { in bpf_program_serialize_attachment_set() argument 412 r = bpf_program_serialize_attachment(f, fds, key, p); in bpf_program_serialize_attachment_set() 420 int bpf_program_deserialize_attachment(const char *v, FDSet *fds, BPFProgram **bpfp) { in bpf_program_deserialize_attachment() argument 459 fd = fdset_remove(fds, ifd); in bpf_program_deserialize_attachment() 481 int bpf_program_deserialize_attachment_set(const char *v, FDSet *fds, Set **bpfsetp) { in bpf_program_deserialize_attachment_set() argument 488 r = bpf_program_deserialize_attachment(v, fds, &p); in bpf_program_deserialize_attachment_set()
|
D | bpf-link.c | 22 int bpf_serialize_link(FILE *f, FDSet *fds, const char *key, struct bpf_link *link) { in bpf_serialize_link() argument 31 return serialize_fd(f, fds, key, sym_bpf_link__fd(link)); in bpf_serialize_link()
|
/systemd-251/src/core/ |
D | manager-serialize.c | 85 FDSet *fds, in manager_serialize() argument 94 assert(fds); in manager_serialize() 141 r = serialize_fd(f, fds, "notify-fd", m->notify_fd); in manager_serialize() 149 r = serialize_fd(f, fds, "cgroups-agent-fd", m->cgroups_agent_fd); in manager_serialize() 157 copy0 = fdset_put_dup(fds, m->user_lookup_fds[0]); in manager_serialize() 161 copy1 = fdset_put_dup(fds, m->user_lookup_fds[1]); in manager_serialize() 170 r = dynamic_user_serialize(m, f, fds); in manager_serialize() 177 r = exec_runtime_serialize(m, f, fds); in manager_serialize() 187 r = unit_serialize(u, f, fds, switching_root); in manager_serialize() 196 r = bus_fdset_add_all(m, fds); in manager_serialize() [all …]
|
D | unit-serialize.c | 93 int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool switching_root) { in unit_serialize() argument 98 assert(fds); in unit_serialize() 115 r = UNIT_VTABLE(u)->serialize(u, f, fds); in unit_serialize() 170 (void) bpf_serialize_socket_bind(u, f, fds); in unit_serialize() 172 …(void) bpf_program_serialize_attachment(f, fds, "ip-bpf-ingress-installed", u->ip_bpf_ingress_inst… in unit_serialize() 173 …(void) bpf_program_serialize_attachment(f, fds, "ip-bpf-egress-installed", u->ip_bpf_egress_instal… in unit_serialize() 174 …(void) bpf_program_serialize_attachment(f, fds, "bpf-device-control-installed", u->bpf_device_cont… in unit_serialize() 175 …(void) bpf_program_serialize_attachment_set(f, fds, "ip-bpf-custom-ingress-installed", u->ip_bpf_c… in unit_serialize() 176 …(void) bpf_program_serialize_attachment_set(f, fds, "ip-bpf-custom-egress-installed", u->ip_bpf_cu… in unit_serialize() 178 (void) serialize_restrict_network_interfaces(u, f, fds); in unit_serialize() [all …]
|
D | dynamic-user.c | 613 int dynamic_user_serialize(Manager *m, FILE *f, FDSet *fds) { in dynamic_user_serialize() argument 618 assert(fds); in dynamic_user_serialize() 625 copy0 = fdset_put_dup(fds, d->storage_socket[0]); in dynamic_user_serialize() 629 copy1 = fdset_put_dup(fds, d->storage_socket[1]); in dynamic_user_serialize() 639 void dynamic_user_deserialize_one(Manager *m, const char *value, FDSet *fds) { in dynamic_user_deserialize_one() argument 645 assert(fds); in dynamic_user_deserialize_one() 655 if (safe_atoi(s0, &fd0) < 0 || !fdset_contains(fds, fd0)) { in dynamic_user_deserialize_one() 660 if (safe_atoi(s1, &fd1) < 0 || !fdset_contains(fds, fd1)) { in dynamic_user_deserialize_one() 671 (void) fdset_remove(fds, fd0); in dynamic_user_deserialize_one() 672 (void) fdset_remove(fds, fd1); in dynamic_user_deserialize_one()
|
D | target.c | 137 static int target_serialize(Unit *u, FILE *f, FDSet *fds) { in target_serialize() argument 142 assert(fds); in target_serialize() 148 static int target_deserialize_item(Unit *u, const char *key, const char *value, FDSet *fds) { in target_deserialize_item() argument 155 assert(fds); in target_deserialize_item()
|
D | restrict-ifaces.c | 158 int serialize_restrict_network_interfaces(Unit *u, FILE *f, FDSet *fds) { in serialize_restrict_network_interfaces() argument 163 … r = bpf_serialize_link(f, fds, "restrict-ifaces-bpf-fd", u->restrict_ifaces_ingress_bpf_link); in serialize_restrict_network_interfaces() 167 … return bpf_serialize_link(f, fds, "restrict-ifaces-bpf-fd", u->restrict_ifaces_egress_bpf_link); in serialize_restrict_network_interfaces() 198 int serialize_restrict_network_interfaces(Unit *u, FILE *f, FDSet *fds) { in serialize_restrict_network_interfaces() argument
|
D | execute.c | 112 static int shift_fds(int fds[], size_t n_fds) { in shift_fds() argument 118 assert(fds); in shift_fds() 127 if (fds[i] == i+3) in shift_fds() 130 nfd = fcntl(fds[i], F_DUPFD, i + 3); in shift_fds() 134 safe_close(fds[i]); in shift_fds() 135 fds[i] = nfd; in shift_fds() 152 static int flags_fds(const int fds[], size_t n_socket_fds, size_t n_storage_fds, bool nonblock) { in flags_fds() argument 160 assert(fds); in flags_fds() 168 r = fd_nonblock(fds[i], nonblock); in flags_fds() 177 r = fd_cloexec(fds[i], false); in flags_fds() [all …]
|
D | bpf-socket-bind.c | 222 int bpf_serialize_socket_bind(Unit *u, FILE *f, FDSet *fds) { in bpf_serialize_socket_bind() argument 227 r = bpf_serialize_link(f, fds, "ipv4-socket-bind-bpf-link", u->ipv4_socket_bind_link); in bpf_serialize_socket_bind() 231 return bpf_serialize_link(f, fds, "ipv6-socket-bind-bpf-link", u->ipv6_socket_bind_link); in bpf_serialize_socket_bind() 247 int bpf_serialize_socket_bind(Unit *u, FILE *f, FDSet *fds) { in bpf_serialize_socket_bind() argument
|
D | main.c | 1118 _cleanup_fdset_free_ FDSet *fds = NULL; in prepare_reexecute() local 1134 fds = fdset_new(); in prepare_reexecute() 1135 if (!fds) in prepare_reexecute() 1138 r = manager_serialize(m, f, fds, switching_root); in prepare_reexecute() 1149 r = fdset_cloexec(fds, false); in prepare_reexecute() 1154 *ret_fds = TAKE_PTR(fds); in prepare_reexecute() 1742 FDSet *fds, in do_reexecute() argument 1789 assert(fds); in do_reexecute() 1829 fds = fdset_free(fds); in do_reexecute() 2658 FDSet *fds = NULL; in main() local [all …]
|
D | manager-serialize.h | 12 int manager_serialize(Manager *m, FILE *f, FDSet *fds, bool switching_root); 13 int manager_deserialize(Manager *m, FILE *f, FDSet *fds);
|
D | unit-serialize.h | 9 int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs); 10 int unit_deserialize(Unit *u, FILE *f, FDSet *fds);
|
D | dynamic-user.h | 28 int dynamic_user_serialize(Manager *m, FILE *f, FDSet *fds); 29 void dynamic_user_deserialize_one(Manager *m, const char *value, FDSet *fds);
|
D | slice.c | 254 static int slice_serialize(Unit *u, FILE *f, FDSet *fds) { in slice_serialize() argument 259 assert(fds); in slice_serialize() 266 static int slice_deserialize_item(Unit *u, const char *key, const char *value, FDSet *fds) { in slice_deserialize_item() argument 272 assert(fds); in slice_deserialize_item()
|
/systemd-251/src/test/ |
D | test-fd-util.c | 26 int fds[3]; in TEST() local 31 fds[0] = mkostemp_safe(name0); in TEST() 32 fds[1] = mkostemp_safe(name1); in TEST() 33 fds[2] = mkostemp_safe(name2); in TEST() 35 close_many(fds, 2); in TEST() 37 assert_se(fcntl(fds[0], F_GETFD) == -1); in TEST() 38 assert_se(fcntl(fds[1], F_GETFD) == -1); in TEST() 39 assert_se(fcntl(fds[2], F_GETFD) >= 0); in TEST() 41 safe_close(fds[2]); in TEST() 193 const int *fds, in validate_fds() argument [all …]
|
/systemd-251/src/libsystemd/sd-resolve/ |
D | sd-resolve.c | 57 int fds[_FD_MAX]; member 419 length = recv(resolve->fds[REQUEST_RECV_FD], &buf, sizeof buf, 0); in thread_worker() 429 … if (handle_request(resolve->fds[RESPONSE_SEND_FD], &buf.packet, (size_t) length) < 0) in thread_worker() 433 send_died(resolve->fds[RESPONSE_SEND_FD]); in thread_worker() 497 resolve->fds[i] = -1; in sd_resolve_new() 499 if (socketpair(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0, resolve->fds + REQUEST_RECV_FD) < 0) in sd_resolve_new() 502 if (socketpair(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0, resolve->fds + RESPONSE_RECV_FD) < 0) in sd_resolve_new() 506 resolve->fds[i] = fd_move_above_stdio(resolve->fds[i]); in sd_resolve_new() 508 (void) fd_inc_sndbuf(resolve->fds[REQUEST_SEND_FD], QUERIES_MAX * BUFSIZE); in sd_resolve_new() 509 (void) fd_inc_rcvbuf(resolve->fds[REQUEST_RECV_FD], QUERIES_MAX * BUFSIZE); in sd_resolve_new() [all …]
|
/systemd-251/src/libsystemd/sd-bus/ |
D | test-bus-server.c | 15 int fds[2]; member 34 assert_se(sd_bus_set_fd(bus, c->fds[0], c->fds[0]) >= 0); in server() 115 assert_se(sd_bus_set_fd(bus, c->fds[1], c->fds[1]) >= 0); in client() 147 assert_se(socketpair(AF_UNIX, SOCK_STREAM, 0, c.fds) >= 0); in test_one()
|
D | bus-message.h | 110 int *fds; member 188 int *fds, 198 int *fds,
|
D | test-bus-objects.c | 18 int fds[2]; member 246 assert_se(sd_bus_set_fd(bus, c->fds[0], c->fds[0]) >= 0); in server() 302 assert_se(sd_bus_set_fd(bus, c->fds[1], c->fds[1]) >= 0); in client() 551 assert_se(socketpair(AF_UNIX, SOCK_STREAM, 0, c.fds) >= 0); in main()
|
/systemd-251/src/libsystemd/sd-journal/ |
D | mmap-cache.c | 60 Hashmap *fds; member 244 hashmap_free(m->fds); in mmap_cache_free() 497 HASHMAP_FOREACH(f, m->fds) { in mmap_cache_process_sigbus() 524 HASHMAP_FOREACH(f, m->fds) { in mmap_cache_process_sigbus() 548 f = hashmap_get(m->fds, FD_TO_PTR(fd)); in mmap_cache_add_fd() 552 r = hashmap_ensure_allocated(&m->fds, NULL); in mmap_cache_add_fd() 560 r = hashmap_put(m->fds, FD_TO_PTR(fd), f); in mmap_cache_add_fd() 585 assert_se(hashmap_remove(f->cache->fds, FD_TO_PTR(f->fd))); in mmap_cache_fd_free()
|
/systemd-251/src/basic/ |
D | io-util.c | 161 int ppoll_usec(struct pollfd *fds, size_t nfds, usec_t timeout) { in ppoll_usec() argument 164 assert(fds || nfds == 0); in ppoll_usec() 169 r = ppoll(fds, nfds, timeout == USEC_INFINITY ? NULL : TIMESPEC_STORE(timeout), NULL); in ppoll_usec() 176 if (fds[i].revents == 0) in ppoll_usec() 178 if (fds[i].revents & POLLNVAL) in ppoll_usec()
|
/systemd-251/src/udev/ |
D | udevadm-lock.c | 320 _cleanup_(fdset_freep) FDSet *fds = NULL; in lock_main() 345 fds = fdset_new(); in lock_main() 346 if (!fds) in lock_main() 370 r = fdset_put(fds, fd); in lock_main()
|