/systemd/src/basic/ |
H A D | fdset.h | 40 int fdset_new_array(FDSet **ret, const int *fds, unsigned n_fds); 44 int fdset_cloexec(FDSet *fds, bool b); 46 int fdset_close_others(FDSet *fds); 48 unsigned fdset_size(FDSet *fds); 49 bool fdset_isempty(FDSet *fds); 53 int fdset_steal_first(FDSet *fds); 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 D | fdset.c | 43 int fdset_new_array(FDSet **ret, const int *fds, unsigned n_fds) { argument 56 r = fdset_put(s, fds[i]); 77 * connection fds and suchlike are closed here, which 190 /* We won't close the fds here! */ 197 int fdset_cloexec(FDSet *fds, bool b) { argument 202 assert(fds); 204 SET_FOREACH(p, MAKE_SET(fds), i) { 245 int fdset_close_others(FDSet *fds) { argument 251 j = 0, m = fdset_size(fds); 253 SET_FOREACH(e, MAKE_SET(fds), 261 fdset_size(FDSet *fds) argument 265 fdset_isempty(FDSet *fds) argument 278 fdset_steal_first(FDSet *fds) argument [all...] |
H A D | fd-util.h | 37 void close_many(const int fds[], unsigned n_fd);
|
H A D | fd-util.c | 60 * unchanged. Is a NOP with negative fds passed, and returns 94 void close_many(const int fds[], unsigned n_fd) { argument 97 assert(fds || n_fd <= 0); 100 safe_close(fds[i]); 270 * have kcmp() this will also return true for two fds of the same 298 /* We consider all device fds different, since two device fds 308 /* The fds refer to the same inode on disk, let's also check
|
/systemd/src/journal/ |
H A D | journald-stream.h | 28 int server_restore_streams(Server *s, FDSet *fds);
|
H A D | mmap-cache.c | 79 Hashmap *fds; member in struct:MMapCache 300 assert_se(hashmap_remove(f->cache->fds, FD_TO_PTR(f->fd))); 312 f = hashmap_get(m->fds, FD_TO_PTR(fd)); 316 r = hashmap_ensure_allocated(&m->fds, NULL); 327 r = hashmap_put(m->fds, FD_TO_PTR(fd), f); 346 while ((f = hashmap_first(m->fds))) 349 hashmap_free(m->fds); 443 f = hashmap_get(m->fds, FD_TO_PTR(fd)); 653 HASHMAP_FOREACH(f, m->fds, i) { 682 HASHMAP_FOREACH(f, m->fds, [all...] |
/systemd/src/libsystemd/sd-bus/ |
H A D | test-bus-server.c | 32 int fds[2]; member in struct:context 51 assert_se(sd_bus_set_fd(bus, c->fds[0], c->fds[0]) >= 0); 131 assert_se(sd_bus_set_fd(bus, c->fds[1], c->fds[1]) >= 0); 165 assert_se(socketpair(AF_UNIX, SOCK_STREAM, 0, c.fds) >= 0);
|
H A D | bus-container.c | 248 int *fds; local 253 fds = (int*) CMSG_DATA(cmsg); 257 close_many(fds, n_fds); 261 fd = fds[0];
|
H A D | bus-message.h | 121 int *fds; member in struct:sd_bus_message 205 int *fds, 215 int *fds,
|
H A D | test-bus-objects.c | 36 int fds[2]; member in struct:context 251 assert_se(sd_bus_set_fd(bus, c->fds[0], c->fds[0]) >= 0); 305 assert_se(sd_bus_set_fd(bus, c->fds[1], c->fds[1]) >= 0); 533 assert_se(socketpair(AF_UNIX, SOCK_STREAM, 0, c.fds) >= 0);
|
H A D | bus-kernel.c | 135 static void append_fds(struct kdbus_item **d, const int fds[], unsigned n_fds) { argument 137 assert(fds); 141 (*d)->size = offsetof(struct kdbus_item, fds) + sizeof(int) * n_fds; 143 memcpy((*d)->fds, fds, sizeof(int) * n_fds); 323 /* Add space for unix fds */ 325 sz += ALIGN8(offsetof(struct kdbus_item, fds) + sizeof(int)*m->n_fds); 401 append_fds(&d, m->fds, m->n_fds); 444 _cleanup_free_ int *fds = NULL; local 490 f = realloc(fds, sizeo [all...] |
/systemd/src/core/ |
H A D | target.c | 145 static int target_serialize(Unit *u, FILE *f, FDSet *fds) { argument 150 assert(fds); 156 static int target_deserialize_item(Unit *u, const char *key, const char *value, FDSet *fds) { argument 162 assert(fds);
|
H A D | dbus.h | 29 int bus_fdset_add_all(Manager *m, FDSet *fds);
|
H A D | main.c | 1063 _cleanup_fdset_free_ FDSet *fds = NULL; local 1079 fds = fdset_new(); 1080 if (!fds) 1083 r = manager_serialize(m, f, fds, switching_root); 1094 r = fdset_cloexec(fds, false); 1096 return log_error_errno(r, "Failed to disable O_CLOEXEC for serialization fds: %m"); 1099 *_fds = fds; 1102 fds = NULL; 1292 FDSet *fds = NULL; local 1577 /* Close logging fds, i [all...] |
H A D | slice.c | 210 static int slice_serialize(Unit *u, FILE *f, FDSet *fds) { argument 215 assert(fds); 221 static int slice_deserialize_item(Unit *u, const char *key, const char *value, FDSet *fds) { argument 227 assert(fds);
|
H A D | execute.c | 110 static int shift_fds(int fds[], unsigned n_fds) { argument 116 /* Modifies the fds array! (sorts it) */ 118 assert(fds); 130 if (fds[i] == i+3) 133 nfd = fcntl(fds[i], F_DUPFD, i + 3); 137 safe_close(fds[i]); 138 fds[i] = nfd; 155 static int flags_fds(const int fds[], unsigned n_fds, bool nonblock) { argument 162 assert(fds); 168 r = fd_nonblock(fds[ 814 setup_pam( const char *name, const char *user, uid_t uid, const char *tty, char ***pam_env, int fds[], unsigned n_fds) argument 1401 close_remaining_fds( const ExecParameters *params, ExecRuntime *runtime, int socket_fd, int *fds, unsigned n_fds) argument 1439 exec_child( Unit *unit, ExecCommand *command, const ExecContext *context, const ExecParameters *params, ExecRuntime *runtime, char **argv, int socket_fd, int *fds, unsigned n_fds, char **files_env, int *exit_status) argument 2067 int *fds = NULL; unsigned n_fds = 0; local 2986 exec_runtime_serialize(Unit *u, ExecRuntime *rt, FILE *f, FDSet *fds) argument 3023 exec_runtime_deserialize_item(Unit *u, ExecRuntime **rt, const char *key, const char *value, FDSet *fds) argument [all...] |
H A D | job.h | 180 int job_serialize(Job *j, FILE *f, FDSet *fds); 181 int job_deserialize(Job *j, FILE *f, FDSet *fds);
|
H A D | manager.c | 1096 static void manager_distribute_fds(Manager *m, FDSet *fds) { argument 1104 if (fdset_size(fds) <= 0) 1110 UNIT_VTABLE(u)->distribute_fds(u, fds); 1114 int manager_startup(Manager *m, FILE *serialization, FDSet *fds) { argument 1149 r = manager_deserialize(m, serialization, fds); 1151 /* Any fds left? Find some unit which wants them. This is 1155 manager_distribute_fds(m, fds); 1496 static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, const char *buf, size_t n, FDSet *fds) { argument 1511 UNIT_VTABLE(u)->notify_message(u, pid, tags, fds); 1517 _cleanup_fdset_free_ FDSet *fds local 2223 manager_serialize(Manager *m, FILE *f, FDSet *fds, bool switching_root) argument 2322 manager_deserialize(Manager *m, FILE *f, FDSet *fds) argument 2506 _cleanup_fdset_free_ FDSet *fds = NULL; local [all...] |
H A D | execute.h | 216 int *fds; member in struct:ExecParameters 285 int exec_runtime_serialize(Unit *unit, ExecRuntime *rt, FILE *f, FDSet *fds); 286 int exec_runtime_deserialize_item(Unit *unit, ExecRuntime **rt, const char *key, const char *value, FDSet *fds);
|
H A D | manager.h | 314 int manager_startup(Manager *m, FILE *serialization, FDSet *fds); 343 int manager_serialize(Manager *m, FILE *f, FDSet *fds, bool switching_root); 344 int manager_deserialize(Manager *m, FILE *f, FDSet *fds);
|
H A D | unit.h | 324 int (*serialize)(Unit *u, FILE *f, FDSet *fds); 327 int (*deserialize_item)(Unit *u, const char *key, const char *data, FDSet *fds); 329 /* Try to match up fds with what we need for this unit */ 330 void (*distribute_fds)(Unit *u, FDSet *fds); 362 void (*notify_message)(Unit *u, pid_t pid, char **tags, FDSet *fds); 533 int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs); 534 int unit_deserialize(Unit *u, FILE *f, FDSet *fds); 538 int unit_serialize_item_fd(Unit *u, FILE *f, FDSet *fds, const char *key, int fd);
|
H A D | scope.c | 364 static int scope_serialize(Unit *u, FILE *f, FDSet *fds) { argument 369 assert(fds); 375 static int scope_deserialize_item(Unit *u, const char *key, const char *value, FDSet *fds) { argument 381 assert(fds);
|
H A D | socket.h | 161 /* Called from the service code when collecting fds */ 162 int socket_collect_fds(Socket *s, int **fds);
|
/systemd/src/systemd/ |
H A D | sd-daemon.h | 65 this function you'll find the file descriptors passed as fds 256 int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char *state, const int *fds, unsigned n_fds);
|
/systemd/src/libsystemd/sd-resolve/ |
H A D | sd-resolve.c | 70 int fds[_FD_MAX]; member in struct:sd_resolve 416 length = recv(resolve->fds[REQUEST_RECV_FD], &buf, sizeof(buf), 0); 429 if (handle_request(resolve->fds[RESPONSE_SEND_FD], &buf.packet, (size_t) length) < 0) 433 send_died(resolve->fds[RESPONSE_SEND_FD]); 480 resolve->fds[i] = -1; 482 r = socketpair(PF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0, resolve->fds + REQUEST_RECV_FD); 488 r = socketpair(PF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0, resolve->fds + RESPONSE_RECV_FD); 494 fd_inc_sndbuf(resolve->fds[REQUEST_SEND_FD], QUERIES_MAX * BUFSIZE); 495 fd_inc_rcvbuf(resolve->fds[REQUEST_RECV_FD], QUERIES_MAX * BUFSIZE); 496 fd_inc_sndbuf(resolve->fds[RESPONSE_SEND_F [all...] |