| cgroup-util.h | | cgroup-util.h | |
| | | | |
| skipping to change at line 31 | | skipping to change at line 31 | |
| along with systemd; If not, see <http://www.gnu.org/licenses/>. | | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
| ***/ | | ***/ | |
| | | | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| #include <dirent.h> | | #include <dirent.h> | |
| | | | |
| #include "set.h" | | #include "set.h" | |
| #include "def.h" | | #include "def.h" | |
| | | | |
|
| | | /* A bit mask of well known cgroup controllers */ | |
| | | typedef enum CGroupControllerMask { | |
| | | CGROUP_CPU = 1, | |
| | | CGROUP_CPUACCT = 2, | |
| | | CGROUP_BLKIO = 4, | |
| | | CGROUP_MEMORY = 8, | |
| | | CGROUP_DEVICE = 16 | |
| | | } CGroupControllerMask; | |
| | | | |
| /* | | /* | |
| * General rules: | | * General rules: | |
| * | | * | |
| * We accept named hierarchies in the syntax "foo" and "name=foo". | | * We accept named hierarchies in the syntax "foo" and "name=foo". | |
| * | | * | |
| * We expect that named hierarchies do not conflict in name with a | | * We expect that named hierarchies do not conflict in name with a | |
| * kernel hierarchy, modulo the "name=" prefix. | | * kernel hierarchy, modulo the "name=" prefix. | |
| * | | * | |
| * We always generate "normalized" controller names, i.e. without the | | * We always generate "normalized" controller names, i.e. without the | |
| * "name=" prefix. | | * "name=" prefix. | |
| * | | * | |
| * We require absolute cgroup paths. When returning, we will always | | * We require absolute cgroup paths. When returning, we will always | |
| * generate paths with multiple adjacent / removed. | | * generate paths with multiple adjacent / removed. | |
| */ | | */ | |
| | | | |
| int cg_enumerate_processes(const char *controller, const char *path, FILE *
*_f); | | int cg_enumerate_processes(const char *controller, const char *path, FILE *
*_f); | |
|
| int cg_enumerate_tasks(const char *controller, const char *path, FILE **_f)
; | | | |
| int cg_read_pid(FILE *f, pid_t *_pid); | | int cg_read_pid(FILE *f, pid_t *_pid); | |
| | | | |
| int cg_enumerate_subgroups(const char *controller, const char *path, DIR **
_d); | | int cg_enumerate_subgroups(const char *controller, const char *path, DIR **
_d); | |
| int cg_read_subgroup(DIR *d, char **fn); | | int cg_read_subgroup(DIR *d, char **fn); | |
| | | | |
| int cg_kill(const char *controller, const char *path, int sig, bool sigcont
, bool ignore_self, Set *s); | | int cg_kill(const char *controller, const char *path, int sig, bool sigcont
, bool ignore_self, Set *s); | |
| int cg_kill_recursive(const char *controller, const char *path, int sig, bo
ol sigcont, bool ignore_self, bool remove, Set *s); | | int cg_kill_recursive(const char *controller, const char *path, int sig, bo
ol sigcont, bool ignore_self, bool remove, Set *s); | |
| int cg_kill_recursive_and_wait(const char *controller, const char *path, bo
ol remove); | | int cg_kill_recursive_and_wait(const char *controller, const char *path, bo
ol remove); | |
| | | | |
| int cg_migrate(const char *cfrom, const char *pfrom, const char *cto, const
char *pto, bool ignore_self); | | int cg_migrate(const char *cfrom, const char *pfrom, const char *cto, const
char *pto, bool ignore_self); | |
| | | | |
| skipping to change at line 71 | | skipping to change at line 79 | |
| int cg_join_spec(const char *controller, const char *path, char **spec); | | int cg_join_spec(const char *controller, const char *path, char **spec); | |
| int cg_mangle_path(const char *path, char **result); | | int cg_mangle_path(const char *path, char **result); | |
| | | | |
| int cg_get_path(const char *controller, const char *path, const char *suffi
x, char **fs); | | int cg_get_path(const char *controller, const char *path, const char *suffi
x, char **fs); | |
| int cg_get_path_and_check(const char *controller, const char *path, const c
har *suffix, char **fs); | | int cg_get_path_and_check(const char *controller, const char *path, const c
har *suffix, char **fs); | |
| | | | |
| int cg_pid_get_path(const char *controller, pid_t pid, char **path); | | int cg_pid_get_path(const char *controller, pid_t pid, char **path); | |
| | | | |
| int cg_trim(const char *controller, const char *path, bool delete_root); | | int cg_trim(const char *controller, const char *path, bool delete_root); | |
| | | | |
|
| int cg_rmdir(const char *controller, const char *path, bool honour_sticky); | | int cg_rmdir(const char *controller, const char *path); | |
| int cg_delete(const char *controller, const char *path); | | int cg_delete(const char *controller, const char *path); | |
| | | | |
|
| int cg_create(const char *controller, const char *path, const char *suffix)
; | | int cg_create(const char *controller, const char *path); | |
| int cg_attach(const char *controller, const char *path, pid_t pid); | | int cg_attach(const char *controller, const char *path, pid_t pid); | |
| int cg_create_and_attach(const char *controller, const char *path, pid_t pi
d); | | int cg_create_and_attach(const char *controller, const char *path, pid_t pi
d); | |
| | | | |
|
| | | int cg_set_attribute(const char *controller, const char *path, const char * | |
| | | attribute, const char *value); | |
| | | | |
| int cg_set_group_access(const char *controller, const char *path, mode_t mo
de, uid_t uid, gid_t gid); | | int cg_set_group_access(const char *controller, const char *path, mode_t mo
de, uid_t uid, gid_t gid); | |
|
| int cg_set_task_access(const char *controller, const char *path, mode_t mod
e, uid_t uid, gid_t gid, int sticky); | | int cg_set_task_access(const char *controller, const char *path, mode_t mod
e, uid_t uid, gid_t gid); | |
| | | | |
| int cg_install_release_agent(const char *controller, const char *agent); | | int cg_install_release_agent(const char *controller, const char *agent); | |
| | | | |
| int cg_is_empty(const char *controller, const char *path, bool ignore_self)
; | | int cg_is_empty(const char *controller, const char *path, bool ignore_self)
; | |
| int cg_is_empty_by_spec(const char *spec, bool ignore_self); | | int cg_is_empty_by_spec(const char *spec, bool ignore_self); | |
| int cg_is_empty_recursive(const char *controller, const char *path, bool ig
nore_self); | | int cg_is_empty_recursive(const char *controller, const char *path, bool ig
nore_self); | |
| | | | |
| int cg_get_root_path(char **path); | | int cg_get_root_path(char **path); | |
|
| int cg_get_system_path(char **path); | | | |
| int cg_get_user_path(char **path); | | | |
| int cg_get_machine_path(const char *machine, char **path); | | | |
| | | | |
| int cg_path_get_session(const char *path, char **session); | | int cg_path_get_session(const char *path, char **session); | |
| int cg_path_get_owner_uid(const char *path, uid_t *uid); | | int cg_path_get_owner_uid(const char *path, uid_t *uid); | |
| int cg_path_get_unit(const char *path, char **unit); | | int cg_path_get_unit(const char *path, char **unit); | |
| int cg_path_get_user_unit(const char *path, char **unit); | | int cg_path_get_user_unit(const char *path, char **unit); | |
| int cg_path_get_machine_name(const char *path, char **machine); | | int cg_path_get_machine_name(const char *path, char **machine); | |
|
| | | int cg_path_get_slice(const char *path, char **slice); | |
| | | | |
| int cg_pid_get_path_shifted(pid_t pid, char **root, char **cgroup); | | int cg_pid_get_path_shifted(pid_t pid, char **root, char **cgroup); | |
| | | | |
| int cg_pid_get_session(pid_t pid, char **session); | | int cg_pid_get_session(pid_t pid, char **session); | |
| int cg_pid_get_owner_uid(pid_t pid, uid_t *uid); | | int cg_pid_get_owner_uid(pid_t pid, uid_t *uid); | |
| int cg_pid_get_unit(pid_t pid, char **unit); | | int cg_pid_get_unit(pid_t pid, char **unit); | |
| int cg_pid_get_user_unit(pid_t pid, char **unit); | | int cg_pid_get_user_unit(pid_t pid, char **unit); | |
| int cg_pid_get_machine_name(pid_t pid, char **machine); | | int cg_pid_get_machine_name(pid_t pid, char **machine); | |
|
| | | int cg_pid_get_slice(pid_t pid, char **slice); | |
| | | | |
| int cg_path_decode_unit(const char *cgroup, char **unit); | | int cg_path_decode_unit(const char *cgroup, char **unit); | |
| | | | |
| char **cg_shorten_controllers(char **controllers); | | char **cg_shorten_controllers(char **controllers); | |
| | | | |
| int cg_controller_from_attr(const char *attr, char **controller); | | int cg_controller_from_attr(const char *attr, char **controller); | |
| | | | |
| char *cg_escape(const char *p); | | char *cg_escape(const char *p); | |
| char *cg_unescape(const char *p) _pure_; | | char *cg_unescape(const char *p) _pure_; | |
| | | | |
| bool cg_controller_is_valid(const char *p, bool allow_named); | | bool cg_controller_is_valid(const char *p, bool allow_named); | |
|
| | | | |
| | | int cg_slice_to_path(const char *unit, char **ret); | |
| | | | |
| | | int cg_create_with_mask(CGroupControllerMask mask, const char *path); | |
| | | int cg_attach_with_mask(CGroupControllerMask mask, const char *path, pid_t | |
| | | pid); | |
| | | int cg_attach_many_with_mask(CGroupControllerMask mask, const char *path, S | |
| | | et* pids); | |
| | | int cg_migrate_with_mask(CGroupControllerMask mask, const char *from, const | |
| | | char *to); | |
| | | int cg_trim_with_mask(CGroupControllerMask mask, const char *path, bool del | |
| | | ete_root); | |
| | | | |
| | | CGroupControllerMask cg_mask_supported(void); | |
| | | | |
End of changes. 10 change blocks. |
| 7 lines changed or deleted | | 17 lines changed or added | |
|
| cgroup.h | | cgroup.h | |
| /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |
| | | | |
| #pragma once | | #pragma once | |
| | | | |
| /*** | | /*** | |
| This file is part of systemd. | | This file is part of systemd. | |
| | | | |
|
| Copyright 2010 Lennart Poettering | | Copyright 2013 Lennart Poettering | |
| | | | |
| systemd is free software; you can redistribute it and/or modify it | | systemd is free software; you can redistribute it and/or modify it | |
| under the terms of the GNU Lesser General Public License as published by | | under the terms of the GNU Lesser General Public License as published by | |
| the Free Software Foundation; either version 2.1 of the License, or | | the Free Software Foundation; either version 2.1 of the License, or | |
| (at your option) any later version. | | (at your option) any later version. | |
| | | | |
| systemd is distributed in the hope that it will be useful, but | | systemd is distributed in the hope that it will be useful, but | |
| WITHOUT ANY WARRANTY; without even the implied warranty of | | WITHOUT ANY WARRANTY; without even the implied warranty of | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| Lesser General Public License for more details. | | Lesser General Public License for more details. | |
| | | | |
| You should have received a copy of the GNU Lesser General Public License | | You should have received a copy of the GNU Lesser General Public License | |
| along with systemd; If not, see <http://www.gnu.org/licenses/>. | | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
| ***/ | | ***/ | |
| | | | |
|
| typedef struct CGroupBonding CGroupBonding; | | #include "list.h" | |
| | | | |
|
| #include "unit.h" | | typedef struct CGroupContext CGroupContext; | |
| | | typedef struct CGroupDeviceAllow CGroupDeviceAllow; | |
| /* Binds a cgroup to a name */ | | typedef struct CGroupBlockIODeviceWeight CGroupBlockIODeviceWeight; | |
| struct CGroupBonding { | | typedef struct CGroupBlockIODeviceBandwidth CGroupBlockIODeviceBandwidth; | |
| char *controller; | | | |
| char *path; | | | |
| | | | |
|
| Unit *unit; | | typedef enum CGroupDevicePolicy { | |
| | | | |
|
| /* For the Unit::cgroup_bondings list */ | | /* When devices listed, will allow those, plus built-in ones, | |
| LIST_FIELDS(CGroupBonding, by_unit); | | if none are listed will allow everything. */ | |
| | | CGROUP_AUTO, | |
| | | | |
|
| /* For the Manager::cgroup_bondings hashmap */ | | /* Everything forbidden, except built-in ones and listed ones. */ | |
| LIST_FIELDS(CGroupBonding, by_path); | | CGROUP_CLOSED, | |
| | | | |
|
| /* When shutting down, remove cgroup? Are our own tasks the | | /* Everythings forbidden, except for the listed devices */ | |
| * only ones in this group?*/ | | CGROUP_STRICT, | |
| bool ours:1; | | | |
| | | | |
|
| /* If we cannot create this group, or add a process to it, is this | | _CGROUP_DEVICE_POLICY_MAX, | |
| fatal? */ | | _CGROUP_DEVICE_POLICY_INVALID = -1 | |
| bool essential:1; | | } CGroupDevicePolicy; | |
| | | | |
|
| /* This cgroup is realized */ | | struct CGroupDeviceAllow { | |
| bool realized:1; | | LIST_FIELDS(CGroupDeviceAllow, device_allow); | |
| | | char *path; | |
| | | bool r:1; | |
| | | bool w:1; | |
| | | bool m:1; | |
| }; | | }; | |
| | | | |
|
| int cgroup_bonding_realize(CGroupBonding *b); | | struct CGroupBlockIODeviceWeight { | |
| int cgroup_bonding_realize_list(CGroupBonding *first); | | LIST_FIELDS(CGroupBlockIODeviceWeight, device_weights); | |
| | | char *path; | |
| void cgroup_bonding_free(CGroupBonding *b, bool trim); | | unsigned long weight; | |
| void cgroup_bonding_free_list(CGroupBonding *first, bool trim); | | }; | |
| | | | |
| int cgroup_bonding_install(CGroupBonding *b, pid_t pid, const char *suffix) | | | |
| ; | | | |
| int cgroup_bonding_install_list(CGroupBonding *first, pid_t pid, const char | | | |
| *suffix); | | | |
| | | | |
|
| int cgroup_bonding_migrate(CGroupBonding *b, CGroupBonding *list); | | struct CGroupBlockIODeviceBandwidth { | |
| int cgroup_bonding_migrate_to(CGroupBonding *b, const char *target, bool re | | LIST_FIELDS(CGroupBlockIODeviceBandwidth, device_bandwidths); | |
| m); | | char *path; | |
| | | uint64_t bandwidth; | |
| | | bool read; | |
| | | }; | |
| | | | |
|
| int cgroup_bonding_set_group_access(CGroupBonding *b, mode_t mode, uid_t ui | | struct CGroupContext { | |
| d, gid_t gid); | | bool cpu_accounting; | |
| int cgroup_bonding_set_group_access_list(CGroupBonding *b, mode_t mode, uid | | bool blockio_accounting; | |
| _t uid, gid_t gid); | | bool memory_accounting; | |
| | | | |
| | | unsigned long cpu_shares; | |
| | | | |
| | | unsigned long blockio_weight; | |
| | | LIST_HEAD(CGroupBlockIODeviceWeight, blockio_device_weights); | |
| | | LIST_HEAD(CGroupBlockIODeviceBandwidth, blockio_device_bandwidths); | |
| | | | |
|
| int cgroup_bonding_set_task_access(CGroupBonding *b, mode_t mode, uid_t uid | | uint64_t memory_limit; | |
| , gid_t gid, int sticky); | | uint64_t memory_soft_limit; | |
| int cgroup_bonding_set_task_access_list(CGroupBonding *b, mode_t mode, uid_ | | | |
| t uid, gid_t gid, int sticky); | | | |
| | | | |
|
| int cgroup_bonding_kill(CGroupBonding *b, int sig, bool sigcont, bool rem, | | CGroupDevicePolicy device_policy; | |
| Set *s, const char *suffix); | | LIST_HEAD(CGroupDeviceAllow, device_allow); | |
| int cgroup_bonding_kill_list(CGroupBonding *first, int sig, bool sigcont, b | | }; | |
| ool rem, Set *s, const char *suffix); | | | |
| | | | |
|
| void cgroup_bonding_trim(CGroupBonding *first, bool delete_root); | | #include "unit.h" | |
| void cgroup_bonding_trim_list(CGroupBonding *first, bool delete_root); | | #include "manager.h" | |
| | | #include "cgroup-util.h" | |
| | | | |
|
| int cgroup_bonding_is_empty(CGroupBonding *b); | | void cgroup_context_init(CGroupContext *c); | |
| int cgroup_bonding_is_empty_list(CGroupBonding *first); | | void cgroup_context_done(CGroupContext *c); | |
| | | void cgroup_context_dump(CGroupContext *c, FILE* f, const char *prefix); | |
| | | void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, cons | |
| | | t char *path); | |
| | | CGroupControllerMask cgroup_context_get_mask(CGroupContext *c); | |
| | | | |
| | | void cgroup_context_free_device_allow(CGroupContext *c, CGroupDeviceAllow * | |
| | | a); | |
| | | void cgroup_context_free_blockio_device_weight(CGroupContext *c, CGroupBloc | |
| | | kIODeviceWeight *w); | |
| | | void cgroup_context_free_blockio_device_bandwidth(CGroupContext *c, CGroupB | |
| | | lockIODeviceBandwidth *b); | |
| | | | |
|
| CGroupBonding *cgroup_bonding_find_list(CGroupBonding *first, const char *c | | int unit_realize_cgroup(Unit *u); | |
| ontroller) _pure_; | | void unit_destroy_cgroup(Unit *u); | |
| | | | |
|
| char *cgroup_bonding_to_string(CGroupBonding *b); | | int manager_setup_cgroup(Manager *m); | |
| | | void manager_shutdown_cgroup(Manager *m, bool delete); | |
| | | | |
|
| pid_t cgroup_bonding_search_main_pid(CGroupBonding *b); | | unsigned manager_dispatch_cgroup_queue(Manager *m); | |
| pid_t cgroup_bonding_search_main_pid_list(CGroupBonding *b); | | | |
| | | | |
|
| #include "manager.h" | | Unit *manager_get_unit_by_cgroup(Manager *m, const char *cgroup); | |
| | | Unit* manager_get_unit_by_pid(Manager *m, pid_t pid); | |
| | | | |
|
| int manager_setup_cgroup(Manager *m); | | pid_t unit_search_main_pid(Unit *u); | |
| void manager_shutdown_cgroup(Manager *m, bool delete); | | | |
| | | | |
|
| int cgroup_bonding_get(Manager *m, const char *cgroup, CGroupBonding **bond | | int manager_notify_cgroup_empty(Manager *m, const char *group); | |
| ing); | | | |
| int cgroup_notify_empty(Manager *m, const char *group); | | | |
| | | | |
|
| Unit* cgroup_unit_by_pid(Manager *m, pid_t pid); | | const char* cgroup_device_policy_to_string(CGroupDevicePolicy i) _const_; | |
| | | CGroupDevicePolicy cgroup_device_policy_from_string(const char *s) _pure_; | |
| | | | |
End of changes. 23 change blocks. |
| 61 lines changed or deleted | | 74 lines changed or added | |
|
| config.h | | config.h | |
| | | | |
| skipping to change at line 89 | | skipping to change at line 89 | |
| /* Define if IMA is available */ | | /* Define if IMA is available */ | |
| #define HAVE_IMA 1 | | #define HAVE_IMA 1 | |
| | | | |
| /* Define to 1 if you have the `inet_ntoa' function. */ | | /* Define to 1 if you have the `inet_ntoa' function. */ | |
| #define HAVE_INET_NTOA 1 | | #define HAVE_INET_NTOA 1 | |
| | | | |
| /* Define to 1 if you have the <inttypes.h> header file. */ | | /* Define to 1 if you have the <inttypes.h> header file. */ | |
| #define HAVE_INTTYPES_H 1 | | #define HAVE_INTTYPES_H 1 | |
| | | | |
| /* Define if kmod is available */ | | /* Define if kmod is available */ | |
|
| #define HAVE_KMOD 1 | | /* #undef HAVE_KMOD */ | |
| | | | |
| /* Define to 1 if you have the <libaudit.h> header file. */ | | /* Define to 1 if you have the <libaudit.h> header file. */ | |
| #define HAVE_LIBAUDIT_H 1 | | #define HAVE_LIBAUDIT_H 1 | |
| | | | |
| /* Define if libcryptsetup is available */ | | /* Define if libcryptsetup is available */ | |
| /* #undef HAVE_LIBCRYPTSETUP */ | | /* #undef HAVE_LIBCRYPTSETUP */ | |
| | | | |
| /* Have tcpwrap? */ | | /* Have tcpwrap? */ | |
| #define HAVE_LIBWRAP /**/ | | #define HAVE_LIBWRAP /**/ | |
| | | | |
| /* Logind support available */ | | /* Logind support available */ | |
| #define HAVE_LOGIND 1 | | #define HAVE_LOGIND 1 | |
| | | | |
|
| | | /* Machined support available */ | |
| | | #define HAVE_MACHINED 1 | |
| | | | |
| /* Define to 1 if your system has a GNU libc compatible `malloc' function,
and | | /* Define to 1 if your system has a GNU libc compatible `malloc' function,
and | |
| to 0 otherwise. */ | | to 0 otherwise. */ | |
| #define HAVE_MALLOC 1 | | #define HAVE_MALLOC 1 | |
| | | | |
| /* Define to 1 if you have the <memory.h> header file. */ | | /* Define to 1 if you have the <memory.h> header file. */ | |
| #define HAVE_MEMORY_H 1 | | #define HAVE_MEMORY_H 1 | |
| | | | |
| /* Define to 1 if you have the `memset' function. */ | | /* Define to 1 if you have the `memset' function. */ | |
| #define HAVE_MEMSET 1 | | #define HAVE_MEMSET 1 | |
| | | | |
| | | | |
| skipping to change at line 149 | | skipping to change at line 152 | |
| | | | |
| /* Define to 1 if you have the <security/pam_modutil.h> header file. */ | | /* Define to 1 if you have the <security/pam_modutil.h> header file. */ | |
| #define HAVE_SECURITY_PAM_MODUTIL_H 1 | | #define HAVE_SECURITY_PAM_MODUTIL_H 1 | |
| | | | |
| /* Define to 1 if you have the `select' function. */ | | /* Define to 1 if you have the `select' function. */ | |
| #define HAVE_SELECT 1 | | #define HAVE_SELECT 1 | |
| | | | |
| /* Define if SELinux is available */ | | /* Define if SELinux is available */ | |
| #define HAVE_SELINUX 1 | | #define HAVE_SELINUX 1 | |
| | | | |
|
| | | /* Define if SMACK is available */ | |
| | | #define HAVE_SMACK 1 | |
| | | | |
| /* Define to 1 if you have the `socket' function. */ | | /* Define to 1 if you have the `socket' function. */ | |
| #define HAVE_SOCKET 1 | | #define HAVE_SOCKET 1 | |
| | | | |
| /* Define if /bin, /sbin aren't symlinks into /usr */ | | /* Define if /bin, /sbin aren't symlinks into /usr */ | |
| /* #undef HAVE_SPLIT_USR */ | | /* #undef HAVE_SPLIT_USR */ | |
| | | | |
| /* Define to 1 if you have the <stdint.h> header file. */ | | /* Define to 1 if you have the <stdint.h> header file. */ | |
| #define HAVE_STDINT_H 1 | | #define HAVE_STDINT_H 1 | |
| | | | |
| /* Define to 1 if you have the <stdlib.h> header file. */ | | /* Define to 1 if you have the <stdlib.h> header file. */ | |
| | | | |
| skipping to change at line 250 | | skipping to change at line 256 | |
| /* Name of package */ | | /* Name of package */ | |
| #define PACKAGE "systemd" | | #define PACKAGE "systemd" | |
| | | | |
| /* Define to the address where bug reports for this package should be sent.
*/ | | /* Define to the address where bug reports for this package should be sent.
*/ | |
| #define PACKAGE_BUGREPORT "http://bugs.freedesktop.org/enter_bug.cgi?produc
t=systemd" | | #define PACKAGE_BUGREPORT "http://bugs.freedesktop.org/enter_bug.cgi?produc
t=systemd" | |
| | | | |
| /* Define to the full name of this package. */ | | /* Define to the full name of this package. */ | |
| #define PACKAGE_NAME "systemd" | | #define PACKAGE_NAME "systemd" | |
| | | | |
| /* Define to the full name and version of this package. */ | | /* Define to the full name and version of this package. */ | |
|
| #define PACKAGE_STRING "systemd 204" | | #define PACKAGE_STRING "systemd 205" | |
| | | | |
| /* Define to the one symbol short name of this package. */ | | /* Define to the one symbol short name of this package. */ | |
| #define PACKAGE_TARNAME "systemd" | | #define PACKAGE_TARNAME "systemd" | |
| | | | |
| /* Define to the home page for this package. */ | | /* Define to the home page for this package. */ | |
| #define PACKAGE_URL "http://www.freedesktop.org/wiki/Software/systemd" | | #define PACKAGE_URL "http://www.freedesktop.org/wiki/Software/systemd" | |
| | | | |
| /* Define to the version of this package. */ | | /* Define to the version of this package. */ | |
|
| #define PACKAGE_VERSION "204" | | #define PACKAGE_VERSION "205" | |
| | | | |
| /* Path of /etc/rc.local script */ | | /* Path of /etc/rc.local script */ | |
| #define RC_LOCAL_SCRIPT_PATH_START "/etc/rc.local" | | #define RC_LOCAL_SCRIPT_PATH_START "/etc/rc.local" | |
| | | | |
| /* Path of /usr/sbin/halt.local script */ | | /* Path of /usr/sbin/halt.local script */ | |
| #define RC_LOCAL_SCRIPT_PATH_STOP "/usr/sbin/halt.local" | | #define RC_LOCAL_SCRIPT_PATH_STOP "/usr/sbin/halt.local" | |
| | | | |
| /* Define to the type of arg 1 for `select'. */ | | /* Define to the type of arg 1 for `select'. */ | |
| #define SELECT_TYPE_ARG1 int | | #define SELECT_TYPE_ARG1 int | |
| | | | |
| | | | |
| skipping to change at line 310 | | skipping to change at line 316 | |
| /* Enable extensions on HP NonStop. */ | | /* Enable extensions on HP NonStop. */ | |
| #ifndef _TANDEM_SOURCE | | #ifndef _TANDEM_SOURCE | |
| # define _TANDEM_SOURCE 1 | | # define _TANDEM_SOURCE 1 | |
| #endif | | #endif | |
| /* Enable general extensions on Solaris. */ | | /* Enable general extensions on Solaris. */ | |
| #ifndef __EXTENSIONS__ | | #ifndef __EXTENSIONS__ | |
| # define __EXTENSIONS__ 1 | | # define __EXTENSIONS__ 1 | |
| #endif | | #endif | |
| | | | |
| /* Version number of package */ | | /* Version number of package */ | |
|
| #define VERSION "204" | | #define VERSION "205" | |
| | | | |
| /* Enable large inode numbers on Mac OS X 10.5. */ | | /* Enable large inode numbers on Mac OS X 10.5. */ | |
| #ifndef _DARWIN_USE_64_BIT_INODE | | #ifndef _DARWIN_USE_64_BIT_INODE | |
| # define _DARWIN_USE_64_BIT_INODE 1 | | # define _DARWIN_USE_64_BIT_INODE 1 | |
| #endif | | #endif | |
| | | | |
| /* Number of bits in a file offset, on hosts where this is settable. */ | | /* Number of bits in a file offset, on hosts where this is settable. */ | |
| #define _FILE_OFFSET_BITS 64 | | #define _FILE_OFFSET_BITS 64 | |
| | | | |
| /* Define for large files, on AIX-style hosts. */ | | /* Define for large files, on AIX-style hosts. */ | |
| | | | |
End of changes. 6 change blocks. |
| 4 lines changed or deleted | | 10 lines changed or added | |
|
| dbus-unit.h | | dbus-unit.h | |
| | | | |
| skipping to change at line 64 | | skipping to change at line 64 | |
| " </method>\n" \ | | " </method>\n" \ | |
| " <method name=\"ReloadOrTryRestart\">\n" \ | | " <method name=\"ReloadOrTryRestart\">\n" \ | |
| " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | | " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | |
| " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | | " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | |
| " </method>\n" \ | | " </method>\n" \ | |
| " <method name=\"Kill\">\n" \ | | " <method name=\"Kill\">\n" \ | |
| " <arg name=\"who\" type=\"s\" direction=\"in\"/>\n" \ | | " <arg name=\"who\" type=\"s\" direction=\"in\"/>\n" \ | |
| " <arg name=\"signal\" type=\"i\" direction=\"in\"/>\n" \ | | " <arg name=\"signal\" type=\"i\" direction=\"in\"/>\n" \ | |
| " </method>\n" \ | | " </method>\n" \ | |
| " <method name=\"ResetFailed\"/>\n" \ | | " <method name=\"ResetFailed\"/>\n" \ | |
|
| | | " <method name=\"SetProperties\">\n" \ | |
| | | " <arg name=\"runtime\" type=\"b\" direction=\"in\"/>\n" \ | |
| | | " <arg name=\"properties\" type=\"a(sv)\" direction=\"in\"/>\n" \ | |
| | | " </method>\n" \ | |
| " <property name=\"Id\" type=\"s\" access=\"read\"/>\n" \ | | " <property name=\"Id\" type=\"s\" access=\"read\"/>\n" \ | |
| " <property name=\"Names\" type=\"as\" access=\"read\"/>\n" \ | | " <property name=\"Names\" type=\"as\" access=\"read\"/>\n" \ | |
| " <property name=\"Following\" type=\"s\" access=\"read\"/>\n" \ | | " <property name=\"Following\" type=\"s\" access=\"read\"/>\n" \ | |
| " <property name=\"Requires\" type=\"as\" access=\"read\"/>\n" \ | | " <property name=\"Requires\" type=\"as\" access=\"read\"/>\n" \ | |
| " <property name=\"RequiresOverridable\" type=\"as\" access=\"read
\"/>\n" \ | | " <property name=\"RequiresOverridable\" type=\"as\" access=\"read
\"/>\n" \ | |
| " <property name=\"Requisite\" type=\"as\" access=\"read\"/>\n" \ | | " <property name=\"Requisite\" type=\"as\" access=\"read\"/>\n" \ | |
| " <property name=\"RequisiteOverridable\" type=\"as\" access=\"rea
d\"/>\n" \ | | " <property name=\"RequisiteOverridable\" type=\"as\" access=\"rea
d\"/>\n" \ | |
| " <property name=\"Wants\" type=\"as\" access=\"read\"/>\n" \ | | " <property name=\"Wants\" type=\"as\" access=\"read\"/>\n" \ | |
| " <property name=\"BindsTo\" type=\"as\" access=\"read\"/>\n" \ | | " <property name=\"BindsTo\" type=\"as\" access=\"read\"/>\n" \ | |
| " <property name=\"PartOf\" type=\"as\" access=\"read\"/>\n" \ | | " <property name=\"PartOf\" type=\"as\" access=\"read\"/>\n" \ | |
| | | | |
| skipping to change at line 125 | | skipping to change at line 129 | |
| " <property name=\"DefaultDependencies\" type=\"b\" access=\"read\
"/>\n" \ | | " <property name=\"DefaultDependencies\" type=\"b\" access=\"read\
"/>\n" \ | |
| " <property name=\"OnFailureIsolate\" type=\"b\" access=\"read\"/>
\n" \ | | " <property name=\"OnFailureIsolate\" type=\"b\" access=\"read\"/>
\n" \ | |
| " <property name=\"IgnoreOnIsolate\" type=\"b\" access=\"read\"/>\
n" \ | | " <property name=\"IgnoreOnIsolate\" type=\"b\" access=\"read\"/>\
n" \ | |
| " <property name=\"IgnoreOnSnapshot\" type=\"b\" access=\"read\"/>
\n" \ | | " <property name=\"IgnoreOnSnapshot\" type=\"b\" access=\"read\"/>
\n" \ | |
| " <property name=\"NeedDaemonReload\" type=\"b\" access=\"read\"/>
\n" \ | | " <property name=\"NeedDaemonReload\" type=\"b\" access=\"read\"/>
\n" \ | |
| " <property name=\"JobTimeoutUSec\" type=\"t\" access=\"read\"/>\n
" \ | | " <property name=\"JobTimeoutUSec\" type=\"t\" access=\"read\"/>\n
" \ | |
| " <property name=\"ConditionTimestamp\" type=\"t\" access=\"read\"
/>\n" \ | | " <property name=\"ConditionTimestamp\" type=\"t\" access=\"read\"
/>\n" \ | |
| " <property name=\"ConditionTimestampMonotonic\" type=\"t\" access
=\"read\"/>\n" \ | | " <property name=\"ConditionTimestampMonotonic\" type=\"t\" access
=\"read\"/>\n" \ | |
| " <property name=\"ConditionResult\" type=\"b\" access=\"read\"/>\
n" \ | | " <property name=\"ConditionResult\" type=\"b\" access=\"read\"/>\
n" \ | |
| " <property name=\"LoadError\" type=\"(ss)\" access=\"read\"/>\n"
\ | | " <property name=\"LoadError\" type=\"(ss)\" access=\"read\"/>\n"
\ | |
|
| | | " <property name=\"Transient\" type=\"b\" access=\"read\"/>\n" \ | |
| " </interface>\n" | | " </interface>\n" | |
| | | | |
| #define BUS_UNIT_CGROUP_INTERFACE \ | | #define BUS_UNIT_CGROUP_INTERFACE \ | |
|
| " <property name=\"DefaultControlGroup\" type=\"s\" access=\"read\ | | " <property name=\"Slice\" type=\"s\" access=\"read\"/>\n" \ | |
| "/>\n" \ | | " <property name=\"ControlGroup\" type=\"s\" access=\"read\"/>\n" | |
| " <property name=\"ControlGroups\" type=\"as\" access=\"read\"/>\n | | | |
| " \ | | | |
| " <property name=\"ControlGroupAttributes\" type=\"a(sss)\" access | | | |
| =\"read\"/>\n" \ | | | |
| " <method name=\"SetControlGroup\">\n" \ | | | |
| " <arg name=\"group\" type=\"s\" direction=\"in\"/>\n" \ | | | |
| " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | | | |
| " </method>\n" \ | | | |
| " <method name=\"UnsetControlGroup\">\n" \ | | | |
| " <arg name=\"group\" type=\"s\" direction=\"in\"/>\n" \ | | | |
| " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | | | |
| " </method>\n" \ | | | |
| " <method name=\"GetControlGroupAttribute\">\n" \ | | | |
| " <arg name=\"attribute\" type=\"s\" direction=\"in\"/>\n" \ | | | |
| " <arg name=\"values\" type=\"as\" direction=\"out\"/>\n" \ | | | |
| " </method>\n" \ | | | |
| " <method name=\"SetControlGroupAttribute\">\n" \ | | | |
| " <arg name=\"attribute\" type=\"s\" direction=\"in\"/>\n" \ | | | |
| " <arg name=\"values\" type=\"as\" direction=\"in\"/>\n" \ | | | |
| " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | | | |
| " </method>\n" \ | | | |
| " <method name=\"UnsetControlGroupAttribute\">\n" \ | | | |
| " <arg name=\"attribute\" type=\"s\" direction=\"in\"/>\n" \ | | | |
| " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | | | |
| " </method>\n" | | | |
| | | | |
| #define BUS_UNIT_INTERFACES_LIST \ | | #define BUS_UNIT_INTERFACES_LIST \ | |
| BUS_GENERIC_INTERFACES_LIST \ | | BUS_GENERIC_INTERFACES_LIST \ | |
| "org.freedesktop.systemd1.Unit\0" | | "org.freedesktop.systemd1.Unit\0" | |
| | | | |
| extern const BusProperty bus_unit_properties[]; | | extern const BusProperty bus_unit_properties[]; | |
| extern const BusProperty bus_unit_cgroup_properties[]; | | extern const BusProperty bus_unit_cgroup_properties[]; | |
| | | | |
| void bus_unit_send_change_signal(Unit *u); | | void bus_unit_send_change_signal(Unit *u); | |
| void bus_unit_send_removed_signal(Unit *u); | | void bus_unit_send_removed_signal(Unit *u); | |
| | | | |
|
| DBusHandlerResult bus_unit_queue_job( | | DBusHandlerResult bus_unit_queue_job(DBusConnection *connection, DBusMessag | |
| DBusConnection *connection, | | e *message, Unit *u, JobType type, JobMode mode, bool reload_if_possible); | |
| DBusMessage *message, | | | |
| Unit *u, | | int bus_unit_set_properties(Unit *u, DBusMessageIter *i, UnitSetPropertiesM | |
| JobType type, | | ode mode, bool commit, DBusError *error); | |
| JobMode mode, | | | |
| bool reload_if_possible); | | | |
| | | | |
| int bus_unit_cgroup_set(Unit *u, DBusMessageIter *iter); | | | |
| int bus_unit_cgroup_unset(Unit *u, DBusMessageIter *iter); | | | |
| int bus_unit_cgroup_attribute_get(Unit *u, DBusMessageIter *iter, char ***_ | | | |
| result); | | | |
| int bus_unit_cgroup_attribute_set(Unit *u, DBusMessageIter *iter); | | | |
| int bus_unit_cgroup_attribute_unset(Unit *u, DBusMessageIter *iter); | | | |
| | | | |
| extern const DBusObjectPathVTable bus_unit_vtable; | | extern const DBusObjectPathVTable bus_unit_vtable; | |
| | | | |
| extern const char bus_unit_interface[]; | | extern const char bus_unit_interface[]; | |
| | | | |
End of changes. 4 change blocks. |
| 41 lines changed or deleted | | 12 lines changed or added | |
|
| kdbus.h | | kdbus.h | |
| | | | |
| skipping to change at line 24 | | skipping to change at line 24 | |
| #ifndef _KDBUS_H_ | | #ifndef _KDBUS_H_ | |
| #define _KDBUS_H_ | | #define _KDBUS_H_ | |
| | | | |
| #ifndef __KERNEL__ | | #ifndef __KERNEL__ | |
| #include <sys/ioctl.h> | | #include <sys/ioctl.h> | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| #include <linux/types.h> | | #include <linux/types.h> | |
| #endif | | #endif | |
| | | | |
| #define KDBUS_IOC_MAGIC 0x95 | | #define KDBUS_IOC_MAGIC 0x95 | |
|
| | | #define KDBUS_SRC_ID_KERNEL (0) | |
| | | #define KDBUS_DST_ID_WELL_KNOWN_NAME (0) | |
| | | #define KDBUS_MATCH_SRC_ID_ANY (~0ULL) | |
| | | #define KDBUS_DST_ID_BROADCAST (~0ULL) | |
| | | | |
| | | /* Common first elements in a structure which are used to iterate over | |
| | | * a list of elements. */ | |
| | | #define KDBUS_PART_HEADER \ | |
| | | struct { \ | |
| | | __u64 size; \ | |
| | | __u64 type; \ | |
| | | } | |
| | | | |
| /* Message sent from kernel to userspace, when the owner or starter of | | /* Message sent from kernel to userspace, when the owner or starter of | |
| * a well-known name changes */ | | * a well-known name changes */ | |
| struct kdbus_manager_msg_name_change { | | struct kdbus_manager_msg_name_change { | |
| __u64 old_id; | | __u64 old_id; | |
| __u64 new_id; | | __u64 new_id; | |
| __u64 flags; /* 0 or (possibly?) KDBUS_NAME_IN_QU
EUE */ | | __u64 flags; /* 0 or (possibly?) KDBUS_NAME_IN_QU
EUE */ | |
| char name[0]; | | char name[0]; | |
| }; | | }; | |
| | | | |
| | | | |
| skipping to change at line 63 | | skipping to change at line 75 | |
| struct kdbus_audit { | | struct kdbus_audit { | |
| __u64 sessionid; | | __u64 sessionid; | |
| __u64 loginuid; | | __u64 loginuid; | |
| }; | | }; | |
| | | | |
| struct kdbus_timestamp { | | struct kdbus_timestamp { | |
| __u64 monotonic_ns; | | __u64 monotonic_ns; | |
| __u64 realtime_ns; | | __u64 realtime_ns; | |
| }; | | }; | |
| | | | |
|
| #define KDBUS_SRC_ID_KERNEL (0) | | struct kdbus_vec { | |
| #define KDBUS_DST_ID_WELL_KNOWN_NAME (0) | | __u64 size; | |
| #define KDBUS_MATCH_SRC_ID_ANY (~0ULL) | | union { | |
| #define KDBUS_DST_ID_BROADCAST (~0ULL) | | __u64 address; | |
| | | __u64 offset; | |
| | | }; | |
| | | }; | |
| | | | |
| | | struct kdbus_memfd { | |
| | | __u64 size; | |
| | | int fd; | |
| | | __u32 __pad; | |
| | | }; | |
| | | | |
| /* Message Item Types */ | | /* Message Item Types */ | |
| enum { | | enum { | |
|
| KDBUS_MSG_NULL, | | _KDBUS_MSG_NULL, | |
| | | | |
| /* Filled in by userspace */ | | /* Filled in by userspace */ | |
|
| KDBUS_MSG_PAYLOAD, /* .data, inline memory */ | | | |
| KDBUS_MSG_PAYLOAD_VEC, /* .data_vec, reference to memory ar
ea */ | | KDBUS_MSG_PAYLOAD_VEC, /* .data_vec, reference to memory ar
ea */ | |
|
| KDBUS_MSG_UNIX_FDS, /* .data_fds of file descriptors */ | | KDBUS_MSG_PAYLOAD_OFF, /* .data_vec, reference to memory ar | |
| | | ea */ | |
| | | KDBUS_MSG_PAYLOAD_MEMFD, /* file descriptor of a special data | |
| | | file */ | |
| | | KDBUS_MSG_FDS, /* .data_fds of file descriptors */ | |
| KDBUS_MSG_BLOOM, /* for broadcasts, carries bloom fil
ter blob in .data */ | | KDBUS_MSG_BLOOM, /* for broadcasts, carries bloom fil
ter blob in .data */ | |
| KDBUS_MSG_DST_NAME, /* destination's well-known name, in
.str */ | | KDBUS_MSG_DST_NAME, /* destination's well-known name, in
.str */ | |
|
| | | KDBUS_MSG_PRIORITY, /* queue priority for message */ | |
| | | | |
| /* Filled in by kernelspace */ | | /* Filled in by kernelspace */ | |
|
| KDBUS_MSG_SRC_NAMES = 0x200,/* NUL separated string list with we
ll-known names of source */ | | KDBUS_MSG_SRC_NAMES = 0x400,/* NUL separated string list with we
ll-known names of source */ | |
| KDBUS_MSG_TIMESTAMP, /* .timestamp */ | | KDBUS_MSG_TIMESTAMP, /* .timestamp */ | |
| KDBUS_MSG_SRC_CREDS, /* .creds */ | | KDBUS_MSG_SRC_CREDS, /* .creds */ | |
| KDBUS_MSG_SRC_PID_COMM, /* optional, in .str */ | | KDBUS_MSG_SRC_PID_COMM, /* optional, in .str */ | |
| KDBUS_MSG_SRC_TID_COMM, /* optional, in .str */ | | KDBUS_MSG_SRC_TID_COMM, /* optional, in .str */ | |
| KDBUS_MSG_SRC_EXE, /* optional, in .str */ | | KDBUS_MSG_SRC_EXE, /* optional, in .str */ | |
| KDBUS_MSG_SRC_CMDLINE, /* optional, in .str (a chain of NUL
str) */ | | KDBUS_MSG_SRC_CMDLINE, /* optional, in .str (a chain of NUL
str) */ | |
| KDBUS_MSG_SRC_CGROUP, /* optional, in .str */ | | KDBUS_MSG_SRC_CGROUP, /* optional, in .str */ | |
| KDBUS_MSG_SRC_CAPS, /* caps data blob, in .data */ | | KDBUS_MSG_SRC_CAPS, /* caps data blob, in .data */ | |
| KDBUS_MSG_SRC_SECLABEL, /* NUL terminated string, in .str */ | | KDBUS_MSG_SRC_SECLABEL, /* NUL terminated string, in .str */ | |
| KDBUS_MSG_SRC_AUDIT, /* .audit */ | | KDBUS_MSG_SRC_AUDIT, /* .audit */ | |
| | | | |
| /* Special messages from kernel, consisting of one and only one of t
hese data blocks */ | | /* Special messages from kernel, consisting of one and only one of t
hese data blocks */ | |
|
| KDBUS_MSG_NAME_ADD = 0x400,/* .name_change */ | | KDBUS_MSG_NAME_ADD = 0x800,/* .name_change */ | |
| KDBUS_MSG_NAME_REMOVE, /* .name_change */ | | KDBUS_MSG_NAME_REMOVE, /* .name_change */ | |
| KDBUS_MSG_NAME_CHANGE, /* .name_change */ | | KDBUS_MSG_NAME_CHANGE, /* .name_change */ | |
| KDBUS_MSG_ID_ADD, /* .id_change */ | | KDBUS_MSG_ID_ADD, /* .id_change */ | |
| KDBUS_MSG_ID_REMOVE, /* .id_change */ | | KDBUS_MSG_ID_REMOVE, /* .id_change */ | |
| KDBUS_MSG_REPLY_TIMEOUT, /* empty, but .reply_cookie in .kdbu
s_msg is filled in */ | | KDBUS_MSG_REPLY_TIMEOUT, /* empty, but .reply_cookie in .kdbu
s_msg is filled in */ | |
| KDBUS_MSG_REPLY_DEAD, /* dito */ | | KDBUS_MSG_REPLY_DEAD, /* dito */ | |
| }; | | }; | |
| | | | |
|
| enum { | | | |
| KDBUS_VEC_ALIGNED = 1 << 0, | | | |
| }; | | | |
| | | | |
| struct kdbus_vec { | | | |
| __u64 address; | | | |
| __u64 size; | | | |
| __u64 flags; | | | |
| }; | | | |
| | | | |
| /** | | /** | |
| * struct kdbus_item - chain of data blocks | | * struct kdbus_item - chain of data blocks | |
| * | | * | |
| * size: overall data record size | | * size: overall data record size | |
| * type: kdbus_item type of data | | * type: kdbus_item type of data | |
| */ | | */ | |
| struct kdbus_item { | | struct kdbus_item { | |
|
| __u64 size; | | KDBUS_PART_HEADER; | |
| __u64 type; | | | |
| union { | | union { | |
| /* inline data */ | | /* inline data */ | |
| __u8 data[0]; | | __u8 data[0]; | |
| __u32 data32[0]; | | __u32 data32[0]; | |
| __u64 data64[0]; | | __u64 data64[0]; | |
| char str[0]; | | char str[0]; | |
| | | | |
| /* connection */ | | /* connection */ | |
| __u64 id; | | __u64 id; | |
| | | | |
| /* data vector */ | | /* data vector */ | |
| struct kdbus_vec vec; | | struct kdbus_vec vec; | |
| | | | |
| /* process credentials and properties*/ | | /* process credentials and properties*/ | |
| struct kdbus_creds creds; | | struct kdbus_creds creds; | |
| struct kdbus_audit audit; | | struct kdbus_audit audit; | |
| struct kdbus_timestamp timestamp; | | struct kdbus_timestamp timestamp; | |
| | | | |
| /* specific fields */ | | /* specific fields */ | |
|
| | | struct kdbus_memfd memfd; | |
| int fds[0]; | | int fds[0]; | |
| struct kdbus_manager_msg_name_change name_change; | | struct kdbus_manager_msg_name_change name_change; | |
| struct kdbus_manager_msg_id_change id_change; | | struct kdbus_manager_msg_id_change id_change; | |
| }; | | }; | |
| }; | | }; | |
| | | | |
| enum { | | enum { | |
| KDBUS_MSG_FLAGS_EXPECT_REPLY = 1 << 0, | | KDBUS_MSG_FLAGS_EXPECT_REPLY = 1 << 0, | |
| KDBUS_MSG_FLAGS_NO_AUTO_START = 1 << 1, | | KDBUS_MSG_FLAGS_NO_AUTO_START = 1 << 1, | |
| }; | | }; | |
| | | | |
| enum { | | enum { | |
|
| KDBUS_PAYLOAD_NULL, | | KDBUS_PAYLOAD_KERNEL, | |
| KDBUS_PAYLOAD_DBUS1 = 0x4442757356657231ULL, /* 'DBusVer1' */ | | KDBUS_PAYLOAD_DBUS1 = 0x4442757356657231ULL, /* 'DBusVer1' */ | |
| KDBUS_PAYLOAD_GVARIANT = 0x4756617269616e74ULL, /* 'GVariant' */ | | KDBUS_PAYLOAD_GVARIANT = 0x4756617269616e74ULL, /* 'GVariant' */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * struct kdbus_msg | | * struct kdbus_msg | |
| * | | * | |
| * set by userspace: | | * set by userspace: | |
| * dst_id: destination id | | * dst_id: destination id | |
| * flags: KDBUS_MSG_FLAGS_* | | * flags: KDBUS_MSG_FLAGS_* | |
| | | | |
| skipping to change at line 183 | | skipping to change at line 196 | |
| __u64 payload_type; /* 'DBusVer1', 'GVariant', ... */ | | __u64 payload_type; /* 'DBusVer1', 'GVariant', ... */ | |
| __u64 cookie; /* userspace-supplied cookie */ | | __u64 cookie; /* userspace-supplied cookie */ | |
| union { | | union { | |
| __u64 cookie_reply; /* cookie we reply to */ | | __u64 cookie_reply; /* cookie we reply to */ | |
| __u64 timeout_ns; /* timespan to wait for reply */ | | __u64 timeout_ns; /* timespan to wait for reply */ | |
| }; | | }; | |
| struct kdbus_item items[0]; | | struct kdbus_item items[0]; | |
| }; | | }; | |
| | | | |
| enum { | | enum { | |
|
| KDBUS_POLICY_NULL, | | _KDBUS_POLICY_NULL, | |
| KDBUS_POLICY_NAME, | | KDBUS_POLICY_NAME, | |
| KDBUS_POLICY_ACCESS, | | KDBUS_POLICY_ACCESS, | |
| }; | | }; | |
| | | | |
| enum { | | enum { | |
|
| KDBUS_POLICY_ACCESS_NULL, | | _KDBUS_POLICY_ACCESS_NULL, | |
| KDBUS_POLICY_ACCESS_USER, | | KDBUS_POLICY_ACCESS_USER, | |
| KDBUS_POLICY_ACCESS_GROUP, | | KDBUS_POLICY_ACCESS_GROUP, | |
| KDBUS_POLICY_ACCESS_WORLD, | | KDBUS_POLICY_ACCESS_WORLD, | |
| }; | | }; | |
| | | | |
| enum { | | enum { | |
| KDBUS_POLICY_RECV = 1 << 2, | | KDBUS_POLICY_RECV = 1 << 2, | |
| KDBUS_POLICY_SEND = 1 << 1, | | KDBUS_POLICY_SEND = 1 << 1, | |
| KDBUS_POLICY_OWN = 1 << 0, | | KDBUS_POLICY_OWN = 1 << 0, | |
| }; | | }; | |
| | | | |
|
| | | struct kdbus_policy_access { | |
| | | __u64 type; /* USER, GROUP, WORLD */ | |
| | | __u64 bits; /* RECV, SEND, OWN */ | |
| | | __u64 id; /* uid, gid, 0 */ | |
| | | }; | |
| | | | |
| | | //FIXME: convert access to access[] | |
| struct kdbus_policy { | | struct kdbus_policy { | |
|
| __u64 size; | | KDBUS_PART_HEADER; | |
| __u64 type; /* NAME or ACCESS */ | | | |
| union { | | union { | |
| char name[0]; | | char name[0]; | |
|
| struct { | | struct kdbus_policy_access access; | |
| __u32 type; /* USER, GROUP, WORLD */ | | | |
| __u32 bits; /* RECV, SEND, OWN */ | | | |
| __u64 id; /* uid, gid, 0 */ | | | |
| } access; | | | |
| }; | | }; | |
| }; | | }; | |
| | | | |
|
| | | /* A series of KDBUS_POLICY_NAME, plus one or more KDBUS_POLICY_ACCESS */ | |
| struct kdbus_cmd_policy { | | struct kdbus_cmd_policy { | |
| __u64 size; | | __u64 size; | |
|
| __u8 buffer[0]; /* a series of KDBUS_POLICY_NAME plus one or | | struct kdbus_policy policies[0]; | |
| * more KDBUS_POLICY_ACCESS each. */ | | | |
| }; | | }; | |
| | | | |
| /* Flags for struct kdbus_cmd_hello */ | | /* Flags for struct kdbus_cmd_hello */ | |
| enum { | | enum { | |
| KDBUS_HELLO_STARTER = 1 << 0, | | KDBUS_HELLO_STARTER = 1 << 0, | |
| KDBUS_HELLO_ACCEPT_FD = 1 << 1, | | KDBUS_HELLO_ACCEPT_FD = 1 << 1, | |
| | | | |
| /* The following have an effect on directed messages only -- | | /* The following have an effect on directed messages only -- | |
| * not for broadcasts */ | | * not for broadcasts */ | |
| KDBUS_HELLO_ATTACH_COMM = 1 << 10, | | KDBUS_HELLO_ATTACH_COMM = 1 << 10, | |
| KDBUS_HELLO_ATTACH_EXE = 1 << 11, | | KDBUS_HELLO_ATTACH_EXE = 1 << 11, | |
| KDBUS_HELLO_ATTACH_CMDLINE = 1 << 12, | | KDBUS_HELLO_ATTACH_CMDLINE = 1 << 12, | |
| KDBUS_HELLO_ATTACH_CGROUP = 1 << 13, | | KDBUS_HELLO_ATTACH_CGROUP = 1 << 13, | |
| KDBUS_HELLO_ATTACH_CAPS = 1 << 14, | | KDBUS_HELLO_ATTACH_CAPS = 1 << 14, | |
| KDBUS_HELLO_ATTACH_SECLABEL = 1 << 15, | | KDBUS_HELLO_ATTACH_SECLABEL = 1 << 15, | |
| KDBUS_HELLO_ATTACH_AUDIT = 1 << 16, | | KDBUS_HELLO_ATTACH_AUDIT = 1 << 16, | |
| }; | | }; | |
| | | | |
|
| /* Items to append to struct kdbus_cmd_hello */ | | | |
| enum { | | | |
| KDBUS_HELLO_NULL, | | | |
| }; | | | |
| | | | |
| struct kdbus_cmd_hello { | | struct kdbus_cmd_hello { | |
| __u64 size; | | __u64 size; | |
| | | | |
| /* userspace → kernel, kernel → userspace */ | | /* userspace → kernel, kernel → userspace */ | |
| __u64 conn_flags; /* userspace specifies its | | __u64 conn_flags; /* userspace specifies its | |
| * capabilities and more, kernel | | * capabilities and more, kernel | |
| * returns its capabilites and | | * returns its capabilites and | |
| * more. Kernel might refuse client's | | * more. Kernel might refuse client's | |
| * capabilities by returning an error | | * capabilities by returning an error | |
| * from KDBUS_HELLO */ | | * from KDBUS_HELLO */ | |
| | | | |
| /* kernel → userspace */ | | /* kernel → userspace */ | |
| __u64 bus_flags; /* this is .flags copied verbatim from | | __u64 bus_flags; /* this is .flags copied verbatim from | |
| * from original KDBUS_CMD_BUS_MAKE | | * from original KDBUS_CMD_BUS_MAKE | |
| * ioctl. It's intended to be useful | | * ioctl. It's intended to be useful | |
| * to do negotiation of features of | | * to do negotiation of features of | |
| * the payload that is transfreted. */ | | * the payload that is transfreted. */ | |
| __u64 id; /* id assigned to this connection */ | | __u64 id; /* id assigned to this connection */ | |
| __u64 bloom_size; /* The bloom filter size chosen by the | | __u64 bloom_size; /* The bloom filter size chosen by the | |
| * bus owner */ | | * bus owner */ | |
|
| | | __u64 pool_size; /* maximum size of pool buffer */ | |
| struct kdbus_item items[0]; | | struct kdbus_item items[0]; | |
| }; | | }; | |
| | | | |
| /* Flags for kdbus_cmd_{bus,ep,ns}_make */ | | /* Flags for kdbus_cmd_{bus,ep,ns}_make */ | |
| enum { | | enum { | |
| KDBUS_MAKE_ACCESS_GROUP = 1 << 0, | | KDBUS_MAKE_ACCESS_GROUP = 1 << 0, | |
| KDBUS_MAKE_ACCESS_WORLD = 1 << 1, | | KDBUS_MAKE_ACCESS_WORLD = 1 << 1, | |
| KDBUS_MAKE_POLICY_OPEN = 1 << 2, | | KDBUS_MAKE_POLICY_OPEN = 1 << 2, | |
| }; | | }; | |
| | | | |
| /* Items to append to kdbus_cmd_{bus,ep,ns}_make */ | | /* Items to append to kdbus_cmd_{bus,ep,ns}_make */ | |
| enum { | | enum { | |
|
| KDBUS_MAKE_NULL, | | _KDBUS_MAKE_NULL, | |
| KDBUS_MAKE_NAME, | | KDBUS_MAKE_NAME, | |
| KDBUS_MAKE_CGROUP, /* the cgroup hierarchy ID for which to atta
ch | | KDBUS_MAKE_CGROUP, /* the cgroup hierarchy ID for which to atta
ch | |
|
| * cgroup membership paths * to messages. */ | | * cgroup membership paths to messages. | |
| | | * FIXME: remove, use *the* hierarchy */ | |
| KDBUS_MAKE_CRED, /* allow translator services which connect | | KDBUS_MAKE_CRED, /* allow translator services which connect | |
| * to the bus on behalf of somebody else, | | * to the bus on behalf of somebody else, | |
|
| * allow specifying the credentials of the | | * allow specifiying the credentials of the | |
| * client to connect on behalf on. Needs | | * client to connect on behalf on. Needs | |
| * privileges */ | | * privileges */ | |
| }; | | }; | |
| | | | |
| struct kdbus_cmd_bus_make { | | struct kdbus_cmd_bus_make { | |
| __u64 size; | | __u64 size; | |
| __u64 flags; /* userspace → kernel, kernel → userspace | | __u64 flags; /* userspace → kernel, kernel → userspace | |
| * When creating a bus feature | | * When creating a bus feature | |
| * kernel negotiation. */ | | * kernel negotiation. */ | |
| __u64 bus_flags; /* userspace → kernel | | __u64 bus_flags; /* userspace → kernel | |
| * When a bus is created this value is | | * When a bus is created this value is | |
| * copied verbatim into the bus | | * copied verbatim into the bus | |
| * structure and returned from | | * structure and returned from | |
| * KDBUS_CMD_HELLO, later */ | | * KDBUS_CMD_HELLO, later */ | |
| __u64 bloom_size; /* size of the bloom filter for this bus */ | | __u64 bloom_size; /* size of the bloom filter for this bus */ | |
| struct kdbus_item items[0]; | | struct kdbus_item items[0]; | |
|
| | | | |
| }; | | }; | |
| | | | |
| struct kdbus_cmd_ep_make { | | struct kdbus_cmd_ep_make { | |
| __u64 size; | | __u64 size; | |
| __u64 flags; /* userspace → kernel, kernel → userspace | | __u64 flags; /* userspace → kernel, kernel → userspace | |
| * When creating an entry point | | * When creating an entry point | |
| * feature kernel negotiation done the | | * feature kernel negotiation done the | |
| * same way as for | | * same way as for | |
| * KDBUS_CMD_BUS_MAKE. Unused for | | * KDBUS_CMD_BUS_MAKE. Unused for | |
| * now. */ | | * now. */ | |
| | | | |
| skipping to change at line 331 | | skipping to change at line 342 | |
| enum { | | enum { | |
| /* userspace → kernel */ | | /* userspace → kernel */ | |
| KDBUS_NAME_REPLACE_EXISTING = 1 << 0, | | KDBUS_NAME_REPLACE_EXISTING = 1 << 0, | |
| KDBUS_NAME_QUEUE = 1 << 1, | | KDBUS_NAME_QUEUE = 1 << 1, | |
| KDBUS_NAME_ALLOW_REPLACEMENT = 1 << 2, | | KDBUS_NAME_ALLOW_REPLACEMENT = 1 << 2, | |
| | | | |
| /* kernel → userspace */ | | /* kernel → userspace */ | |
| KDBUS_NAME_IN_QUEUE = 1 << 16, | | KDBUS_NAME_IN_QUEUE = 1 << 16, | |
| }; | | }; | |
| | | | |
|
| | | /* We allow (de)regestration of names of other peers */ | |
| struct kdbus_cmd_name { | | struct kdbus_cmd_name { | |
| __u64 size; | | __u64 size; | |
|
| __u64 name_flags; | | __u64 flags; | |
| __u64 id; /* We allow registration/deregestration of n | | __u64 id; | |
| ames of other peers */ | | | |
| __u64 conn_flags; | | __u64 conn_flags; | |
| char name[0]; | | char name[0]; | |
| }; | | }; | |
| | | | |
| struct kdbus_cmd_names { | | struct kdbus_cmd_names { | |
| __u64 size; | | __u64 size; | |
| struct kdbus_cmd_name names[0]; | | struct kdbus_cmd_name names[0]; | |
| }; | | }; | |
| | | | |
| enum { | | enum { | |
|
| KDBUS_NAME_INFO_ITEM_NULL, | | _KDBUS_NAME_INFO_ITEM_NULL, | |
| KDBUS_NAME_INFO_ITEM_NAME, /* userspace → kernel */ | | KDBUS_NAME_INFO_ITEM_NAME, /* userspace → kernel */ | |
| KDBUS_NAME_INFO_ITEM_SECLABEL, /* kernel → userspace */ | | KDBUS_NAME_INFO_ITEM_SECLABEL, /* kernel → userspace */ | |
| KDBUS_NAME_INFO_ITEM_AUDIT, /* kernel → userspace */ | | KDBUS_NAME_INFO_ITEM_AUDIT, /* kernel → userspace */ | |
| }; | | }; | |
| | | | |
| struct kdbus_cmd_name_info { | | struct kdbus_cmd_name_info { | |
| __u64 size; /* overall size of info */ | | __u64 size; /* overall size of info */ | |
| __u64 flags; | | __u64 flags; | |
| __u64 id; /* either ID, or 0 and _ITEM_NAME fo
llows */ | | __u64 id; /* either ID, or 0 and _ITEM_NAME fo
llows */ | |
| struct kdbus_creds creds; | | struct kdbus_creds creds; | |
| struct kdbus_item items[0]; /* list of item records */ | | struct kdbus_item items[0]; /* list of item records */ | |
| }; | | }; | |
| | | | |
| enum { | | enum { | |
|
| KDBUS_MATCH_NULL, | | _KDBUS_MATCH_NULL, | |
| KDBUS_MATCH_BLOOM, /* Matches a mask blob against KDBUS
_MSG_BLOOM */ | | KDBUS_MATCH_BLOOM, /* Matches a mask blob against KDBUS
_MSG_BLOOM */ | |
| KDBUS_MATCH_SRC_NAME, /* Matches a name string against KDB
US_MSG_SRC_NAMES */ | | KDBUS_MATCH_SRC_NAME, /* Matches a name string against KDB
US_MSG_SRC_NAMES */ | |
| KDBUS_MATCH_NAME_ADD, /* Matches a name string against KDB
US_MSG_NAME_ADD */ | | KDBUS_MATCH_NAME_ADD, /* Matches a name string against KDB
US_MSG_NAME_ADD */ | |
| KDBUS_MATCH_NAME_REMOVE, /* Matches a name string against KDB
US_MSG_NAME_REMOVE */ | | KDBUS_MATCH_NAME_REMOVE, /* Matches a name string against KDB
US_MSG_NAME_REMOVE */ | |
| KDBUS_MATCH_NAME_CHANGE, /* Matches a name string against KDB
US_MSG_NAME_CHANGE */ | | KDBUS_MATCH_NAME_CHANGE, /* Matches a name string against KDB
US_MSG_NAME_CHANGE */ | |
| KDBUS_MATCH_ID_ADD, /* Matches an ID against KDBUS_MSG_I
D_ADD */ | | KDBUS_MATCH_ID_ADD, /* Matches an ID against KDBUS_MSG_I
D_ADD */ | |
| KDBUS_MATCH_ID_REMOVE, /* Matches an ID against KDBUS_MSG_I
D_REMOVE */ | | KDBUS_MATCH_ID_REMOVE, /* Matches an ID against KDBUS_MSG_I
D_REMOVE */ | |
| }; | | }; | |
| | | | |
| struct kdbus_cmd_match { | | struct kdbus_cmd_match { | |
| __u64 size; | | __u64 size; | |
| __u64 id; /* We allow registration/deregestration of matches f
or other peers */ | | __u64 id; /* We allow registration/deregestration of matches f
or other peers */ | |
| __u64 cookie; /* userspace supplied cookie; when removing; kernel
deletes everything with same cookie */ | | __u64 cookie; /* userspace supplied cookie; when removing; kernel
deletes everything with same cookie */ | |
| __u64 src_id; /* ~0: any. other: exact unique match */ | | __u64 src_id; /* ~0: any. other: exact unique match */ | |
| struct kdbus_item items[0]; | | struct kdbus_item items[0]; | |
| }; | | }; | |
| | | | |
| struct kdbus_cmd_monitor { | | struct kdbus_cmd_monitor { | |
| __u64 id; /* We allow setting the monitor flag of othe
r peers */ | | __u64 id; /* We allow setting the monitor flag of othe
r peers */ | |
|
| unsigned int enabled; /* A boolean to enable/disable monitoring */ | | unsigned int enable; /* A boolean to enable/disable monitoring */ | |
| | | __u32 __pad; | |
| }; | | }; | |
| | | | |
| /* FD states: | | /* FD states: | |
| * control nodes: unset | | * control nodes: unset | |
| * bus owner (via KDBUS_CMD_BUS_MAKE) | | * bus owner (via KDBUS_CMD_BUS_MAKE) | |
| * ns owner (via KDBUS_CMD_NS_MAKE) | | * ns owner (via KDBUS_CMD_NS_MAKE) | |
| * | | * | |
| * ep nodes: unset | | * ep nodes: unset | |
| * connected (via KDBUS_CMD_HELLO) | | * connected (via KDBUS_CMD_HELLO) | |
| * starter (via KDBUS_CMD_HELLO with KDBUS_CMD_HELLO_STARTER) | | * starter (via KDBUS_CMD_HELLO with KDBUS_CMD_HELLO_STARTER) | |
| * ep owner (via KDBUS_CMD_EP_MAKE) | | * ep owner (via KDBUS_CMD_EP_MAKE) | |
| */ | | */ | |
|
| enum kdbus_cmd { | | enum { | |
| /* kdbus control node commands: require unset state */ | | /* kdbus control node commands: require unset state */ | |
|
| KDBUS_CMD_BUS_MAKE = _IOWR(KDBUS_IOC_MAGIC, 0x00, struct | | KDBUS_CMD_BUS_MAKE = _IOW(KDBUS_IOC_MAGIC, 0x00, struct k | |
| kdbus_cmd_bus_make), | | dbus_cmd_bus_make), | |
| KDBUS_CMD_NS_MAKE = _IOWR(KDBUS_IOC_MAGIC, 0x10, struct | | KDBUS_CMD_NS_MAKE = _IOR(KDBUS_IOC_MAGIC, 0x10, struct k | |
| kdbus_cmd_ns_make), | | dbus_cmd_ns_make), | |
| | | | |
| /* kdbus ep node commands: require unset state */ | | /* kdbus ep node commands: require unset state */ | |
|
| KDBUS_CMD_EP_MAKE = _IOWR(KDBUS_IOC_MAGIC, 0x20, struct
kdbus_cmd_ep_make), | | KDBUS_CMD_EP_MAKE = _IOW(KDBUS_IOC_MAGIC, 0x20, struct k
dbus_cmd_ep_make), | |
| KDBUS_CMD_HELLO = _IOWR(KDBUS_IOC_MAGIC, 0x30, struct
kdbus_cmd_hello), | | KDBUS_CMD_HELLO = _IOWR(KDBUS_IOC_MAGIC, 0x30, struct
kdbus_cmd_hello), | |
| | | | |
| /* kdbus ep node commands: require connected state */ | | /* kdbus ep node commands: require connected state */ | |
|
| KDBUS_CMD_MSG_SEND = _IOWR(KDBUS_IOC_MAGIC, 0x40, struct | | KDBUS_CMD_MSG_SEND = _IOW(KDBUS_IOC_MAGIC, 0x40, struct k | |
| kdbus_msg), | | dbus_msg), | |
| KDBUS_CMD_MSG_RECV = _IOWR(KDBUS_IOC_MAGIC, 0x41, struct | | KDBUS_CMD_MSG_RECV = _IOR(KDBUS_IOC_MAGIC, 0x41, __u64 *) | |
| kdbus_msg), | | , | |
| | | KDBUS_CMD_MSG_RELEASE = _IOW(KDBUS_IOC_MAGIC, 0x42, __u64 *) | |
| | | , | |
| | | | |
| KDBUS_CMD_NAME_ACQUIRE = _IOWR(KDBUS_IOC_MAGIC, 0x50, struct
kdbus_cmd_name), | | KDBUS_CMD_NAME_ACQUIRE = _IOWR(KDBUS_IOC_MAGIC, 0x50, struct
kdbus_cmd_name), | |
|
| KDBUS_CMD_NAME_RELEASE = _IOWR(KDBUS_IOC_MAGIC, 0x51, struct
kdbus_cmd_name), | | KDBUS_CMD_NAME_RELEASE = _IOW(KDBUS_IOC_MAGIC, 0x51, struct k
dbus_cmd_name), | |
| KDBUS_CMD_NAME_LIST = _IOWR(KDBUS_IOC_MAGIC, 0x52, struct
kdbus_cmd_names), | | KDBUS_CMD_NAME_LIST = _IOWR(KDBUS_IOC_MAGIC, 0x52, struct
kdbus_cmd_names), | |
| KDBUS_CMD_NAME_QUERY = _IOWR(KDBUS_IOC_MAGIC, 0x53, struct
kdbus_cmd_name_info), | | KDBUS_CMD_NAME_QUERY = _IOWR(KDBUS_IOC_MAGIC, 0x53, struct
kdbus_cmd_name_info), | |
| | | | |
|
| KDBUS_CMD_MATCH_ADD = _IOWR(KDBUS_IOC_MAGIC, 0x60, struct | | KDBUS_CMD_MATCH_ADD = _IOW(KDBUS_IOC_MAGIC, 0x60, struct k | |
| kdbus_cmd_match), | | dbus_cmd_match), | |
| KDBUS_CMD_MATCH_REMOVE = _IOWR(KDBUS_IOC_MAGIC, 0x61, struct | | KDBUS_CMD_MATCH_REMOVE = _IOW(KDBUS_IOC_MAGIC, 0x61, struct k | |
| kdbus_cmd_match), | | dbus_cmd_match), | |
| KDBUS_CMD_MONITOR = _IOWR(KDBUS_IOC_MAGIC, 0x62, struct | | KDBUS_CMD_MONITOR = _IOW(KDBUS_IOC_MAGIC, 0x62, struct k | |
| kdbus_cmd_monitor), | | dbus_cmd_monitor), | |
| | | | |
| /* kdbus ep node commands: require ep owner state */ | | /* kdbus ep node commands: require ep owner state */ | |
|
| KDBUS_CMD_EP_POLICY_SET = _IOWR(KDBUS_IOC_MAGIC, 0x70, struct | | KDBUS_CMD_EP_POLICY_SET = _IOW(KDBUS_IOC_MAGIC, 0x70, struct k | |
| kdbus_cmd_policy), | | dbus_cmd_policy), | |
| | | | |
| | | /* kdbus memfd commands: */ | |
| | | KDBUS_CMD_MEMFD_NEW = _IOR(KDBUS_IOC_MAGIC, 0x80, int *), | |
| | | KDBUS_CMD_MEMFD_SIZE_GET = _IOR(KDBUS_IOC_MAGIC, 0x81, __u64 *) | |
| | | , | |
| | | KDBUS_CMD_MEMFD_SIZE_SET = _IOW(KDBUS_IOC_MAGIC, 0x82, __u64 *) | |
| | | , | |
| | | KDBUS_CMD_MEMFD_SEAL_GET = _IOR(KDBUS_IOC_MAGIC, 0x83, int *), | |
| | | KDBUS_CMD_MEMFD_SEAL_SET = _IO(KDBUS_IOC_MAGIC, 0x84), | |
| }; | | }; | |
| #endif | | #endif | |
| | | | |
End of changes. 37 change blocks. |
| 67 lines changed or deleted | | 92 lines changed or added | |
|
| load-fragment.h | | load-fragment.h | |
| | | | |
| skipping to change at line 58 | | skipping to change at line 58 | |
| int config_parse_input(const char *unit, const char *filename, unsigned lin
e, const char *section, const char *lvalue, int ltype, const char *rvalue,
void *data, void *userdata); | | int config_parse_input(const char *unit, const char *filename, unsigned lin
e, const char *section, const char *lvalue, int ltype, const char *rvalue,
void *data, void *userdata); | |
| int config_parse_exec_io_class(const char *unit, const char *filename, unsi
gned line, const char *section, const char *lvalue, int ltype, const char *
rvalue, void *data, void *userdata); | | int config_parse_exec_io_class(const char *unit, const char *filename, unsi
gned line, const char *section, const char *lvalue, int ltype, const char *
rvalue, void *data, void *userdata); | |
| int config_parse_exec_io_priority(const char *unit, const char *filename, u
nsigned line, const char *section, const char *lvalue, int ltype, const cha
r *rvalue, void *data, void *userdata); | | int config_parse_exec_io_priority(const char *unit, const char *filename, u
nsigned line, const char *section, const char *lvalue, int ltype, const cha
r *rvalue, void *data, void *userdata); | |
| int config_parse_exec_cpu_sched_policy(const char *unit, const char *filena
me, unsigned line, const char *section, const char *lvalue, int ltype, cons
t char *rvalue, void *data, void *userdata); | | int config_parse_exec_cpu_sched_policy(const char *unit, const char *filena
me, unsigned line, const char *section, const char *lvalue, int ltype, cons
t char *rvalue, void *data, void *userdata); | |
| int config_parse_exec_cpu_sched_prio(const char *unit, const char *filename
, unsigned line, const char *section, const char *lvalue, int ltype, const
char *rvalue, void *data, void *userdata); | | int config_parse_exec_cpu_sched_prio(const char *unit, const char *filename
, unsigned line, const char *section, const char *lvalue, int ltype, const
char *rvalue, void *data, void *userdata); | |
| int config_parse_exec_cpu_affinity(const char *unit, const char *filename,
unsigned line, const char *section, const char *lvalue, int ltype, const ch
ar *rvalue, void *data, void *userdata); | | int config_parse_exec_cpu_affinity(const char *unit, const char *filename,
unsigned line, const char *section, const char *lvalue, int ltype, const ch
ar *rvalue, void *data, void *userdata); | |
| int config_parse_exec_capabilities(const char *unit, const char *filename,
unsigned line, const char *section, const char *lvalue, int ltype, const ch
ar *rvalue, void *data, void *userdata); | | int config_parse_exec_capabilities(const char *unit, const char *filename,
unsigned line, const char *section, const char *lvalue, int ltype, const ch
ar *rvalue, void *data, void *userdata); | |
| int config_parse_exec_secure_bits(const char *unit, const char *filename, u
nsigned line, const char *section, const char *lvalue, int ltype, const cha
r *rvalue, void *data, void *userdata); | | int config_parse_exec_secure_bits(const char *unit, const char *filename, u
nsigned line, const char *section, const char *lvalue, int ltype, const cha
r *rvalue, void *data, void *userdata); | |
| int config_parse_bounding_set(const char *unit, const char *filename, unsig
ned line, const char *section, const char *lvalue, int ltype, const char *r
value, void *data, void *userdata); | | int config_parse_bounding_set(const char *unit, const char *filename, unsig
ned line, const char *section, const char *lvalue, int ltype, const char *r
value, void *data, void *userdata); | |
| int config_parse_limit(const char *unit, const char *filename, unsigned lin
e, const char *section, const char *lvalue, int ltype, const char *rvalue,
void *data, void *userdata); | | int config_parse_limit(const char *unit, const char *filename, unsigned lin
e, const char *section, const char *lvalue, int ltype, const char *rvalue,
void *data, void *userdata); | |
|
| int config_parse_unit_cgroup(const char *unit, const char *filename, unsign
ed line, const char *section, const char *lvalue, int ltype, const char *rv
alue, void *data, void *userdata); | | | |
| int config_parse_sysv_priority(const char *unit, const char *filename, unsi
gned line, const char *section, const char *lvalue, int ltype, const char *
rvalue, void *data, void *userdata); | | int config_parse_sysv_priority(const char *unit, const char *filename, unsi
gned line, const char *section, const char *lvalue, int ltype, const char *
rvalue, void *data, void *userdata); | |
| int config_parse_fsck_passno(const char *unit, const char *filename, unsign
ed line, const char *section, const char *lvalue, int ltype, const char *rv
alue, void *data, void *userdata); | | int config_parse_fsck_passno(const char *unit, const char *filename, unsign
ed line, const char *section, const char *lvalue, int ltype, const char *rv
alue, void *data, void *userdata); | |
| int config_parse_kill_signal(const char *unit, const char *filename, unsign
ed line, const char *section, const char *lvalue, int ltype, const char *rv
alue, void *data, void *userdata); | | int config_parse_kill_signal(const char *unit, const char *filename, unsign
ed line, const char *section, const char *lvalue, int ltype, const char *rv
alue, void *data, void *userdata); | |
| int config_parse_exec_mount_flags(const char *unit, const char *filename, u
nsigned line, const char *section, const char *lvalue, int ltype, const cha
r *rvalue, void *data, void *userdata); | | int config_parse_exec_mount_flags(const char *unit, const char *filename, u
nsigned line, const char *section, const char *lvalue, int ltype, const cha
r *rvalue, void *data, void *userdata); | |
| int config_parse_timer(const char *unit, const char *filename, unsigned lin
e, const char *section, const char *lvalue, int ltype, const char *rvalue,
void *data, void *userdata); | | int config_parse_timer(const char *unit, const char *filename, unsigned lin
e, const char *section, const char *lvalue, int ltype, const char *rvalue,
void *data, void *userdata); | |
| int config_parse_trigger_unit(const char *unit, const char *filename, unsig
ned line, const char *section, const char *lvalue, int ltype, const char *r
value, void *data, void *userdata); | | int config_parse_trigger_unit(const char *unit, const char *filename, unsig
ned line, const char *section, const char *lvalue, int ltype, const char *r
value, void *data, void *userdata); | |
| int config_parse_path_spec(const char *unit, const char *filename, unsigned
line, const char *section, const char *lvalue, int ltype, const char *rval
ue, void *data, void *userdata); | | int config_parse_path_spec(const char *unit, const char *filename, unsigned
line, const char *section, const char *lvalue, int ltype, const char *rval
ue, void *data, void *userdata); | |
| int config_parse_socket_service(const char *unit, const char *filename, uns
igned line, const char *section, const char *lvalue, int ltype, const char
*rvalue, void *data, void *userdata); | | int config_parse_socket_service(const char *unit, const char *filename, uns
igned line, const char *section, const char *lvalue, int ltype, const char
*rvalue, void *data, void *userdata); | |
| int config_parse_service_sockets(const char *unit, const char *filename, un
signed line, const char *section, const char *lvalue, int ltype, const char
*rvalue, void *data, void *userdata); | | int config_parse_service_sockets(const char *unit, const char *filename, un
signed line, const char *section, const char *lvalue, int ltype, const char
*rvalue, void *data, void *userdata); | |
| int config_parse_unit_env_file(const char *unit, const char *filename, unsi
gned line, const char *section, const char *lvalue, int ltype, const char *
rvalue, void *data, void *userdata); | | int config_parse_unit_env_file(const char *unit, const char *filename, unsi
gned line, const char *section, const char *lvalue, int ltype, const char *
rvalue, void *data, void *userdata); | |
| int config_parse_ip_tos(const char *unit, const char *filename, unsigned li
ne, const char *section, const char *lvalue, int ltype, const char *rvalue,
void *data, void *userdata); | | int config_parse_ip_tos(const char *unit, const char *filename, unsigned li
ne, const char *section, const char *lvalue, int ltype, const char *rvalue,
void *data, void *userdata); | |
| int config_parse_unit_condition_path(const char *unit, const char *filename
, unsigned line, const char *section, const char *lvalue, int ltype, const
char *rvalue, void *data, void *userdata); | | int config_parse_unit_condition_path(const char *unit, const char *filename
, unsigned line, const char *section, const char *lvalue, int ltype, const
char *rvalue, void *data, void *userdata); | |
| int config_parse_unit_condition_string(const char *unit, const char *filena
me, unsigned line, const char *section, const char *lvalue, int ltype, cons
t char *rvalue, void *data, void *userdata); | | int config_parse_unit_condition_string(const char *unit, const char *filena
me, unsigned line, const char *section, const char *lvalue, int ltype, cons
t char *rvalue, void *data, void *userdata); | |
| int config_parse_unit_condition_null(const char *unit, const char *filename
, unsigned line, const char *section, const char *lvalue, int ltype, const
char *rvalue, void *data, void *userdata); | | int config_parse_unit_condition_null(const char *unit, const char *filename
, unsigned line, const char *section, const char *lvalue, int ltype, const
char *rvalue, void *data, void *userdata); | |
| int config_parse_kill_mode(const char *unit, const char *filename, unsigned
line, const char *section, const char *lvalue, int ltype, const char *rval
ue, void *data, void *userdata); | | int config_parse_kill_mode(const char *unit, const char *filename, unsigned
line, const char *section, const char *lvalue, int ltype, const char *rval
ue, void *data, void *userdata); | |
| int config_parse_notify_access(const char *unit, const char *filename, unsi
gned line, const char *section, const char *lvalue, int ltype, const char *
rvalue, void *data, void *userdata); | | int config_parse_notify_access(const char *unit, const char *filename, unsi
gned line, const char *section, const char *lvalue, int ltype, const char *
rvalue, void *data, void *userdata); | |
| int config_parse_start_limit_action(const char *unit, const char *filename,
unsigned line, const char *section, const char *lvalue, int ltype, const c
har *rvalue, void *data, void *userdata); | | int config_parse_start_limit_action(const char *unit, const char *filename,
unsigned line, const char *section, const char *lvalue, int ltype, const c
har *rvalue, void *data, void *userdata); | |
|
| int config_parse_unit_cgroup_attr(const char *unit, const char *filename, u | | | |
| nsigned line, const char *section, const char *lvalue, int ltype, const cha | | | |
| r *rvalue, void *data, void *userdata); | | | |
| int config_parse_unit_cgroup_attr_pretty(const char *unit, const char *file | | | |
| name, unsigned line, const char *section, const char *lvalue, int ltype, co | | | |
| nst char *rvalue, void *data, void *userdata); | | | |
| int config_parse_unit_requires_mounts_for(const char *unit, const char *fil
ename, unsigned line, const char *section, const char *lvalue, int ltype, c
onst char *rvalue, void *data, void *userdata); | | int config_parse_unit_requires_mounts_for(const char *unit, const char *fil
ename, unsigned line, const char *section, const char *lvalue, int ltype, c
onst char *rvalue, void *data, void *userdata); | |
| int config_parse_syscall_filter(const char *unit, const char *filename, uns
igned line, const char *section, const char *lvalue, int ltype, const char
*rvalue, void *data, void *userdata); | | int config_parse_syscall_filter(const char *unit, const char *filename, uns
igned line, const char *section, const char *lvalue, int ltype, const char
*rvalue, void *data, void *userdata); | |
| int config_parse_environ(const char *unit, const char *filename, unsigned l
ine, const char *section, const char *lvalue, int ltype, const char *rvalue
, void *data, void *userdata); | | int config_parse_environ(const char *unit, const char *filename, unsigned l
ine, const char *section, const char *lvalue, int ltype, const char *rvalue
, void *data, void *userdata); | |
|
| | | int config_parse_unit_slice(const char *unit, const char *filename, unsigne | |
| | | d line, const char *section, const char *lvalue, int ltype, const char *rva | |
| | | lue, void *data, void *userdata); | |
| | | int config_parse_cpu_shares(const char *unit, const char *filename, unsigne | |
| | | d line, const char *section, const char *lvalue, int ltype, const char *rva | |
| | | lue, void *data, void *userdata); | |
| | | int config_parse_memory_limit(const char *unit, const char *filename, unsig | |
| | | ned line, const char *section, const char *lvalue, int ltype, const char *r | |
| | | value, void *data, void *userdata); | |
| | | int config_parse_device_policy(const char *unit, const char *filename, unsi | |
| | | gned line, const char *section, const char *lvalue, int ltype, const char * | |
| | | rvalue, void *data, void *userdata); | |
| | | int config_parse_device_allow(const char *unit, const char *filename, unsig | |
| | | ned line, const char *section, const char *lvalue, int ltype, const char *r | |
| | | value, void *data, void *userdata); | |
| | | int config_parse_blockio_weight(const char *unit, const char *filename, uns | |
| | | igned line, const char *section, const char *lvalue, int ltype, const char | |
| | | *rvalue, void *data, void *userdata); | |
| | | int config_parse_blockio_bandwidth(const char *unit, const char *filename, | |
| | | unsigned line, const char *section, const char *lvalue, int ltype, const ch | |
| | | ar *rvalue, void *data, void *userdata); | |
| | | | |
| /* gperf prototypes */ | | /* gperf prototypes */ | |
| const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, un
signed length); | | const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, un
signed length); | |
| extern const char load_fragment_gperf_nulstr[]; | | extern const char load_fragment_gperf_nulstr[]; | |
| | | | |
End of changes. 3 change blocks. |
| 7 lines changed or deleted | | 21 lines changed or added | |
|
| logind-session.h | | logind-session.h | |
| | | | |
| skipping to change at line 25 | | skipping to change at line 25 | |
| systemd is distributed in the hope that it will be useful, but | | systemd is distributed in the hope that it will be useful, but | |
| WITHOUT ANY WARRANTY; without even the implied warranty of | | WITHOUT ANY WARRANTY; without even the implied warranty of | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| Lesser General Public License for more details. | | Lesser General Public License for more details. | |
| | | | |
| You should have received a copy of the GNU Lesser General Public License | | You should have received a copy of the GNU Lesser General Public License | |
| along with systemd; If not, see <http://www.gnu.org/licenses/>. | | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
| ***/ | | ***/ | |
| | | | |
| typedef struct Session Session; | | typedef struct Session Session; | |
|
| | | typedef enum KillWho KillWho; | |
| | | | |
| #include "list.h" | | #include "list.h" | |
| #include "util.h" | | #include "util.h" | |
| #include "logind.h" | | #include "logind.h" | |
| #include "logind-seat.h" | | #include "logind-seat.h" | |
| #include "logind-user.h" | | #include "logind-user.h" | |
| | | | |
| typedef enum SessionState { | | typedef enum SessionState { | |
|
| | | SESSION_OPENING, /* Session scope is being created */ | |
| SESSION_ONLINE, /* Logged in */ | | SESSION_ONLINE, /* Logged in */ | |
| SESSION_ACTIVE, /* Logged in and in the fg */ | | SESSION_ACTIVE, /* Logged in and in the fg */ | |
|
| SESSION_CLOSING, /* Logged out, but processes still remain */ | | SESSION_CLOSING, /* Logged out, but scope is still there */ | |
| _SESSION_STATE_MAX, | | _SESSION_STATE_MAX, | |
| _SESSION_STATE_INVALID = -1 | | _SESSION_STATE_INVALID = -1 | |
| } SessionState; | | } SessionState; | |
| | | | |
| typedef enum SessionClass { | | typedef enum SessionClass { | |
| SESSION_USER, | | SESSION_USER, | |
| SESSION_GREETER, | | SESSION_GREETER, | |
| SESSION_LOCK_SCREEN, | | SESSION_LOCK_SCREEN, | |
| SESSION_BACKGROUND, | | SESSION_BACKGROUND, | |
| _SESSION_CLASS_MAX, | | _SESSION_CLASS_MAX, | |
| | | | |
| skipping to change at line 57 | | skipping to change at line 59 | |
| } SessionClass; | | } SessionClass; | |
| | | | |
| typedef enum SessionType { | | typedef enum SessionType { | |
| SESSION_UNSPECIFIED, | | SESSION_UNSPECIFIED, | |
| SESSION_TTY, | | SESSION_TTY, | |
| SESSION_X11, | | SESSION_X11, | |
| _SESSION_TYPE_MAX, | | _SESSION_TYPE_MAX, | |
| _SESSION_TYPE_INVALID = -1 | | _SESSION_TYPE_INVALID = -1 | |
| } SessionType; | | } SessionType; | |
| | | | |
|
| typedef enum KillWho { | | enum KillWho { | |
| KILL_LEADER, | | KILL_LEADER, | |
| KILL_ALL, | | KILL_ALL, | |
| _KILL_WHO_MAX, | | _KILL_WHO_MAX, | |
| _KILL_WHO_INVALID = -1 | | _KILL_WHO_INVALID = -1 | |
|
| } KillWho; | | }; | |
| | | | |
| struct Session { | | struct Session { | |
| Manager *manager; | | Manager *manager; | |
| | | | |
| char *id; | | char *id; | |
| SessionType type; | | SessionType type; | |
| SessionClass class; | | SessionClass class; | |
| | | | |
| char *state_file; | | char *state_file; | |
| | | | |
| User *user; | | User *user; | |
| | | | |
| dual_timestamp timestamp; | | dual_timestamp timestamp; | |
| | | | |
| char *tty; | | char *tty; | |
| char *display; | | char *display; | |
| | | | |
| bool remote; | | bool remote; | |
| char *remote_user; | | char *remote_user; | |
| char *remote_host; | | char *remote_host; | |
|
| | | | |
| char *service; | | char *service; | |
| | | | |
|
| | | char *scope; | |
| | | char *scope_job; | |
| | | | |
| int vtnr; | | int vtnr; | |
| Seat *seat; | | Seat *seat; | |
| | | | |
| pid_t leader; | | pid_t leader; | |
| uint32_t audit_id; | | uint32_t audit_id; | |
| | | | |
| int fifo_fd; | | int fifo_fd; | |
| char *fifo_path; | | char *fifo_path; | |
| | | | |
|
| char *cgroup_path; | | | |
| char **controllers, **reset_controllers; | | | |
| | | | |
| bool idle_hint; | | bool idle_hint; | |
| dual_timestamp idle_hint_timestamp; | | dual_timestamp idle_hint_timestamp; | |
| | | | |
|
| bool kill_processes; | | | |
| bool in_gc_queue:1; | | bool in_gc_queue:1; | |
| bool started:1; | | bool started:1; | |
| | | | |
|
| | | DBusMessage *create_message; | |
| | | | |
| LIST_FIELDS(Session, sessions_by_user); | | LIST_FIELDS(Session, sessions_by_user); | |
| LIST_FIELDS(Session, sessions_by_seat); | | LIST_FIELDS(Session, sessions_by_seat); | |
| | | | |
| LIST_FIELDS(Session, gc_queue); | | LIST_FIELDS(Session, gc_queue); | |
| }; | | }; | |
| | | | |
|
| Session *session_new(Manager *m, User *u, const char *id); | | Session *session_new(Manager *m, const char *id); | |
| void session_free(Session *s); | | void session_free(Session *s); | |
|
| | | void session_set_user(Session *s, User *u); | |
| int session_check_gc(Session *s, bool drop_not_started); | | int session_check_gc(Session *s, bool drop_not_started); | |
| void session_add_to_gc_queue(Session *s); | | void session_add_to_gc_queue(Session *s); | |
| int session_activate(Session *s); | | int session_activate(Session *s); | |
| bool session_is_active(Session *s); | | bool session_is_active(Session *s); | |
| int session_get_idle_hint(Session *s, dual_timestamp *t); | | int session_get_idle_hint(Session *s, dual_timestamp *t); | |
| void session_set_idle_hint(Session *s, bool b); | | void session_set_idle_hint(Session *s, bool b); | |
| int session_create_fifo(Session *s); | | int session_create_fifo(Session *s); | |
| void session_remove_fifo(Session *s); | | void session_remove_fifo(Session *s); | |
| int session_start(Session *s); | | int session_start(Session *s); | |
| int session_stop(Session *s); | | int session_stop(Session *s); | |
| | | | |
| skipping to change at line 138 | | skipping to change at line 141 | |
| | | | |
| SessionState session_get_state(Session *u); | | SessionState session_get_state(Session *u); | |
| | | | |
| extern const DBusObjectPathVTable bus_session_vtable; | | extern const DBusObjectPathVTable bus_session_vtable; | |
| | | | |
| int session_send_signal(Session *s, bool new_session); | | int session_send_signal(Session *s, bool new_session); | |
| int session_send_changed(Session *s, const char *properties); | | int session_send_changed(Session *s, const char *properties); | |
| int session_send_lock(Session *s, bool lock); | | int session_send_lock(Session *s, bool lock); | |
| int session_send_lock_all(Manager *m, bool lock); | | int session_send_lock_all(Manager *m, bool lock); | |
| | | | |
|
| | | int session_send_create_reply(Session *s, DBusError *error); | |
| | | | |
| const char* session_state_to_string(SessionState t) _const_; | | const char* session_state_to_string(SessionState t) _const_; | |
| SessionState session_state_from_string(const char *s) _pure_; | | SessionState session_state_from_string(const char *s) _pure_; | |
| | | | |
| const char* session_type_to_string(SessionType t) _const_; | | const char* session_type_to_string(SessionType t) _const_; | |
| SessionType session_type_from_string(const char *s) _pure_; | | SessionType session_type_from_string(const char *s) _pure_; | |
| | | | |
| const char* session_class_to_string(SessionClass t) _const_; | | const char* session_class_to_string(SessionClass t) _const_; | |
| SessionClass session_class_from_string(const char *s) _pure_; | | SessionClass session_class_from_string(const char *s) _pure_; | |
| | | | |
| const char *kill_who_to_string(KillWho k) _const_; | | const char *kill_who_to_string(KillWho k) _const_; | |
| | | | |
End of changes. 13 change blocks. |
| 9 lines changed or deleted | | 14 lines changed or added | |
|
| logind.h | | logind.h | |
| | | | |
| skipping to change at line 77 | | skipping to change at line 77 | |
| int bus_fd; | | int bus_fd; | |
| int epoll_fd; | | int epoll_fd; | |
| | | | |
| unsigned n_autovts; | | unsigned n_autovts; | |
| | | | |
| unsigned reserve_vt; | | unsigned reserve_vt; | |
| int reserve_vt_fd; | | int reserve_vt_fd; | |
| | | | |
| Seat *vtconsole; | | Seat *vtconsole; | |
| | | | |
|
| char *cgroup_path; | | | |
| char **controllers, **reset_controllers; | | | |
| | | | |
| char **kill_only_users, **kill_exclude_users; | | char **kill_only_users, **kill_exclude_users; | |
|
| | | | |
| bool kill_user_processes; | | bool kill_user_processes; | |
| | | | |
| unsigned long session_counter; | | unsigned long session_counter; | |
| unsigned long inhibit_counter; | | unsigned long inhibit_counter; | |
| | | | |
|
| Hashmap *session_cgroups; | | Hashmap *session_units; | |
| Hashmap *user_cgroups; | | Hashmap *user_units; | |
| | | | |
| Hashmap *session_fds; | | Hashmap *session_fds; | |
| Hashmap *inhibitor_fds; | | Hashmap *inhibitor_fds; | |
| Hashmap *button_fds; | | Hashmap *button_fds; | |
| | | | |
| usec_t inhibit_delay_max; | | usec_t inhibit_delay_max; | |
| | | | |
| /* If an action is currently being executed or is delayed, | | /* If an action is currently being executed or is delayed, | |
| * this is != 0 and encodes what is being done */ | | * this is != 0 and encodes what is being done */ | |
| InhibitWhat action_what; | | InhibitWhat action_what; | |
| | | | |
| skipping to change at line 142 | | skipping to change at line 138 | |
| FD_IDLE_ACTION, | | FD_IDLE_ACTION, | |
| FD_OTHER_BASE | | FD_OTHER_BASE | |
| }; | | }; | |
| | | | |
| Manager *manager_new(void); | | Manager *manager_new(void); | |
| void manager_free(Manager *m); | | void manager_free(Manager *m); | |
| | | | |
| int manager_add_device(Manager *m, const char *sysfs, Device **_device); | | int manager_add_device(Manager *m, const char *sysfs, Device **_device); | |
| int manager_add_button(Manager *m, const char *name, Button **_button); | | int manager_add_button(Manager *m, const char *name, Button **_button); | |
| int manager_add_seat(Manager *m, const char *id, Seat **_seat); | | int manager_add_seat(Manager *m, const char *id, Seat **_seat); | |
|
| int manager_add_session(Manager *m, User *u, const char *id, Session **_ses
sion); | | int manager_add_session(Manager *m, const char *id, Session **_session); | |
| int manager_add_user(Manager *m, uid_t uid, gid_t gid, const char *name, Us
er **_user); | | int manager_add_user(Manager *m, uid_t uid, gid_t gid, const char *name, Us
er **_user); | |
| int manager_add_user_by_name(Manager *m, const char *name, User **_user); | | int manager_add_user_by_name(Manager *m, const char *name, User **_user); | |
| int manager_add_user_by_uid(Manager *m, uid_t uid, User **_user); | | int manager_add_user_by_uid(Manager *m, uid_t uid, User **_user); | |
| int manager_add_inhibitor(Manager *m, const char* id, Inhibitor **_inhibito
r); | | int manager_add_inhibitor(Manager *m, const char* id, Inhibitor **_inhibito
r); | |
| | | | |
| int manager_process_seat_device(Manager *m, struct udev_device *d); | | int manager_process_seat_device(Manager *m, struct udev_device *d); | |
| int manager_process_button_device(Manager *m, struct udev_device *d); | | int manager_process_button_device(Manager *m, struct udev_device *d); | |
| | | | |
| int manager_dispatch_seat_udev(Manager *m); | | int manager_dispatch_seat_udev(Manager *m); | |
| int manager_dispatch_vcsa_udev(Manager *m); | | int manager_dispatch_vcsa_udev(Manager *m); | |
| | | | |
| skipping to change at line 168 | | skipping to change at line 164 | |
| int manager_enumerate_buttons(Manager *m); | | int manager_enumerate_buttons(Manager *m); | |
| int manager_enumerate_seats(Manager *m); | | int manager_enumerate_seats(Manager *m); | |
| int manager_enumerate_sessions(Manager *m); | | int manager_enumerate_sessions(Manager *m); | |
| int manager_enumerate_users(Manager *m); | | int manager_enumerate_users(Manager *m); | |
| int manager_enumerate_inhibitors(Manager *m); | | int manager_enumerate_inhibitors(Manager *m); | |
| | | | |
| int manager_startup(Manager *m); | | int manager_startup(Manager *m); | |
| int manager_run(Manager *m); | | int manager_run(Manager *m); | |
| int manager_spawn_autovt(Manager *m, int vtnr); | | int manager_spawn_autovt(Manager *m, int vtnr); | |
| | | | |
|
| void manager_cgroup_notify_empty(Manager *m, const char *cgroup); | | | |
| | | | |
| void manager_gc(Manager *m, bool drop_not_started); | | void manager_gc(Manager *m, bool drop_not_started); | |
| | | | |
| int manager_get_idle_hint(Manager *m, dual_timestamp *t); | | int manager_get_idle_hint(Manager *m, dual_timestamp *t); | |
| | | | |
|
| int manager_get_user_by_cgroup(Manager *m, const char *cgroup, User **user) | | int manager_get_user_by_pid(Manager *m, pid_t pid, User **user); | |
| ; | | | |
| int manager_get_session_by_cgroup(Manager *m, const char *cgroup, Session * | | | |
| *session); | | | |
| int manager_get_session_by_pid(Manager *m, pid_t pid, Session **session); | | int manager_get_session_by_pid(Manager *m, pid_t pid, Session **session); | |
| | | | |
| extern const DBusObjectPathVTable bus_manager_vtable; | | extern const DBusObjectPathVTable bus_manager_vtable; | |
| | | | |
| DBusHandlerResult bus_message_filter(DBusConnection *c, DBusMessage *messag
e, void *userdata); | | DBusHandlerResult bus_message_filter(DBusConnection *c, DBusMessage *messag
e, void *userdata); | |
| | | | |
| int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, const char *unit
_name, InhibitWhat w, DBusError *error); | | int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, const char *unit
_name, InhibitWhat w, DBusError *error); | |
| | | | |
| int manager_send_changed(Manager *manager, const char *properties); | | int manager_send_changed(Manager *manager, const char *properties); | |
| | | | |
| int manager_dispatch_delayed(Manager *manager); | | int manager_dispatch_delayed(Manager *manager); | |
| | | | |
|
| | | int manager_start_scope(Manager *manager, const char *scope, pid_t pid, con | |
| | | st char *slice, const char *description, DBusError *error, char **job); | |
| | | int manager_start_unit(Manager *manager, const char *unit, DBusError *error | |
| | | , char **job); | |
| | | int manager_stop_unit(Manager *manager, const char *unit, DBusError *error, | |
| | | char **job); | |
| | | int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int | |
| | | signo, DBusError *error); | |
| | | int manager_unit_is_active(Manager *manager, const char *unit); | |
| | | | |
| /* gperf lookup function */ | | /* gperf lookup function */ | |
| const struct ConfigPerfItem* logind_gperf_lookup(const char *key, unsigned
length); | | const struct ConfigPerfItem* logind_gperf_lookup(const char *key, unsigned
length); | |
| | | | |
End of changes. 7 change blocks. |
| 13 lines changed or deleted | | 14 lines changed or added | |
|
| manager.h | | manager.h | |
| | | | |
| skipping to change at line 30 | | skipping to change at line 30 | |
| You should have received a copy of the GNU Lesser General Public License | | You should have received a copy of the GNU Lesser General Public License | |
| along with systemd; If not, see <http://www.gnu.org/licenses/>. | | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
| ***/ | | ***/ | |
| | | | |
| #include <stdbool.h> | | #include <stdbool.h> | |
| #include <inttypes.h> | | #include <inttypes.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| #include <dbus/dbus.h> | | #include <dbus/dbus.h> | |
| | | | |
| #include "fdset.h" | | #include "fdset.h" | |
|
| | | #include "cgroup-util.h" | |
| | | | |
| /* Enforce upper limit how many names we allow */ | | /* Enforce upper limit how many names we allow */ | |
| #define MANAGER_MAX_NAMES 131072 /* 128K */ | | #define MANAGER_MAX_NAMES 131072 /* 128K */ | |
| | | | |
| typedef struct Manager Manager; | | typedef struct Manager Manager; | |
| typedef enum WatchType WatchType; | | typedef enum WatchType WatchType; | |
| typedef struct Watch Watch; | | typedef struct Watch Watch; | |
| | | | |
| typedef enum ManagerExitCode { | | typedef enum ManagerExitCode { | |
| MANAGER_RUNNING, | | MANAGER_RUNNING, | |
| | | | |
| skipping to change at line 89 | | skipping to change at line 90 | |
| }; | | }; | |
| | | | |
| #include "unit.h" | | #include "unit.h" | |
| #include "job.h" | | #include "job.h" | |
| #include "hashmap.h" | | #include "hashmap.h" | |
| #include "list.h" | | #include "list.h" | |
| #include "set.h" | | #include "set.h" | |
| #include "dbus.h" | | #include "dbus.h" | |
| #include "path-lookup.h" | | #include "path-lookup.h" | |
| #include "execute.h" | | #include "execute.h" | |
|
| | | #include "unit-name.h" | |
| | | | |
| struct Manager { | | struct Manager { | |
| /* Note that the set of units we know of is allowed to be | | /* Note that the set of units we know of is allowed to be | |
| * inconsistent. However the subset of it that is loaded may | | * inconsistent. However the subset of it that is loaded may | |
| * not, and the list of jobs may neither. */ | | * not, and the list of jobs may neither. */ | |
| | | | |
| /* Active jobs and units */ | | /* Active jobs and units */ | |
| Hashmap *units; /* name string => Unit object n:1 */ | | Hashmap *units; /* name string => Unit object n:1 */ | |
| Hashmap *jobs; /* job id => Job object 1:1 */ | | Hashmap *jobs; /* job id => Job object 1:1 */ | |
| | | | |
| | | | |
| skipping to change at line 125 | | skipping to change at line 127 | |
| * D-Bus change signals. */ | | * D-Bus change signals. */ | |
| LIST_HEAD(Unit, dbus_unit_queue); | | LIST_HEAD(Unit, dbus_unit_queue); | |
| LIST_HEAD(Job, dbus_job_queue); | | LIST_HEAD(Job, dbus_job_queue); | |
| | | | |
| /* Units to remove */ | | /* Units to remove */ | |
| LIST_HEAD(Unit, cleanup_queue); | | LIST_HEAD(Unit, cleanup_queue); | |
| | | | |
| /* Units to check when doing GC */ | | /* Units to check when doing GC */ | |
| LIST_HEAD(Unit, gc_queue); | | LIST_HEAD(Unit, gc_queue); | |
| | | | |
|
| | | /* Units that should be realized */ | |
| | | LIST_HEAD(Unit, cgroup_queue); | |
| | | | |
| Hashmap *watch_pids; /* pid => Unit object n:1 */ | | Hashmap *watch_pids; /* pid => Unit object n:1 */ | |
| | | | |
| char *notify_socket; | | char *notify_socket; | |
| | | | |
| Watch notify_watch; | | Watch notify_watch; | |
| Watch signal_watch; | | Watch signal_watch; | |
| Watch time_change_watch; | | Watch time_change_watch; | |
| Watch jobs_in_progress_watch; | | Watch jobs_in_progress_watch; | |
| | | | |
| int epoll_fd; | | int epoll_fd; | |
| | | | |
| unsigned n_snapshots; | | unsigned n_snapshots; | |
| | | | |
| LookupPaths lookup_paths; | | LookupPaths lookup_paths; | |
| Set *unit_path_cache; | | Set *unit_path_cache; | |
| | | | |
| char **environment; | | char **environment; | |
|
| char **default_controllers; | | | |
| | | | |
| usec_t runtime_watchdog; | | usec_t runtime_watchdog; | |
| usec_t shutdown_watchdog; | | usec_t shutdown_watchdog; | |
| | | | |
| dual_timestamp firmware_timestamp; | | dual_timestamp firmware_timestamp; | |
| dual_timestamp loader_timestamp; | | dual_timestamp loader_timestamp; | |
| dual_timestamp kernel_timestamp; | | dual_timestamp kernel_timestamp; | |
| dual_timestamp initrd_timestamp; | | dual_timestamp initrd_timestamp; | |
| dual_timestamp userspace_timestamp; | | dual_timestamp userspace_timestamp; | |
| dual_timestamp finish_timestamp; | | dual_timestamp finish_timestamp; | |
|
| | | dual_timestamp generators_start_timestamp; | |
| | | dual_timestamp generators_finish_timestamp; | |
| | | dual_timestamp unitsload_start_timestamp; | |
| | | dual_timestamp unitsload_finish_timestamp; | |
| | | | |
| char *generator_unit_path; | | char *generator_unit_path; | |
| char *generator_unit_path_early; | | char *generator_unit_path_early; | |
| char *generator_unit_path_late; | | char *generator_unit_path_late; | |
| | | | |
| /* Data specific to the device subsystem */ | | /* Data specific to the device subsystem */ | |
| struct udev* udev; | | struct udev* udev; | |
| struct udev_monitor* udev_monitor; | | struct udev_monitor* udev_monitor; | |
| Watch udev_watch; | | Watch udev_watch; | |
| Hashmap *devices_by_sysfs; | | Hashmap *devices_by_sysfs; | |
| | | | |
| skipping to change at line 197 | | skipping to change at line 205 | |
| int32_t conn_data_slot; | | int32_t conn_data_slot; | |
| int32_t subscribed_data_slot; | | int32_t subscribed_data_slot; | |
| | | | |
| uint32_t current_job_id; | | uint32_t current_job_id; | |
| uint32_t default_unit_job_id; | | uint32_t default_unit_job_id; | |
| | | | |
| /* Data specific to the Automount subsystem */ | | /* Data specific to the Automount subsystem */ | |
| int dev_autofs_fd; | | int dev_autofs_fd; | |
| | | | |
| /* Data specific to the cgroup subsystem */ | | /* Data specific to the cgroup subsystem */ | |
|
| Hashmap *cgroup_bondings; /* path string => CGroupBonding object 1: | | Hashmap *cgroup_unit; | |
| n */ | | CGroupControllerMask cgroup_supported; | |
| char *cgroup_hierarchy; | | char *cgroup_root; | |
| | | | |
|
| usec_t gc_queue_timestamp; | | | |
| int gc_marker; | | int gc_marker; | |
| unsigned n_in_gc_queue; | | unsigned n_in_gc_queue; | |
| | | | |
| /* Make sure the user cannot accidentally unmount our cgroup | | /* Make sure the user cannot accidentally unmount our cgroup | |
| * file system */ | | * file system */ | |
| int pin_cgroupfs_fd; | | int pin_cgroupfs_fd; | |
| | | | |
| /* Flags */ | | /* Flags */ | |
| SystemdRunningAs running_as; | | SystemdRunningAs running_as; | |
| ManagerExitCode exit_code:5; | | ManagerExitCode exit_code:5; | |
| | | | |
| skipping to change at line 271 | | skipping to change at line 279 | |
| | | | |
| void manager_dump_units(Manager *s, FILE *f, const char *prefix); | | void manager_dump_units(Manager *s, FILE *f, const char *prefix); | |
| void manager_dump_jobs(Manager *s, FILE *f, const char *prefix); | | void manager_dump_jobs(Manager *s, FILE *f, const char *prefix); | |
| | | | |
| void manager_clear_jobs(Manager *m); | | void manager_clear_jobs(Manager *m); | |
| | | | |
| unsigned manager_dispatch_load_queue(Manager *m); | | unsigned manager_dispatch_load_queue(Manager *m); | |
| unsigned manager_dispatch_run_queue(Manager *m); | | unsigned manager_dispatch_run_queue(Manager *m); | |
| unsigned manager_dispatch_dbus_queue(Manager *m); | | unsigned manager_dispatch_dbus_queue(Manager *m); | |
| | | | |
|
| int manager_set_default_controllers(Manager *m, char **controllers); | | int manager_set_default_environment(Manager *m, char **environment); | |
| int manager_set_default_rlimits(Manager *m, struct rlimit **default_rlimit)
; | | int manager_set_default_rlimits(Manager *m, struct rlimit **default_rlimit)
; | |
| | | | |
| int manager_loop(Manager *m); | | int manager_loop(Manager *m); | |
| | | | |
| void manager_dispatch_bus_name_owner_changed(Manager *m, const char *name,
const char* old_owner, const char *new_owner); | | void manager_dispatch_bus_name_owner_changed(Manager *m, const char *name,
const char* old_owner, const char *new_owner); | |
| void manager_dispatch_bus_query_pid_done(Manager *m, const char *name, pid_
t pid); | | void manager_dispatch_bus_query_pid_done(Manager *m, const char *name, pid_
t pid); | |
| | | | |
| int manager_open_serialization(Manager *m, FILE **_f); | | int manager_open_serialization(Manager *m, FILE **_f); | |
| | | | |
| int manager_serialize(Manager *m, FILE *f, FDSet *fds, bool switching_root)
; | | int manager_serialize(Manager *m, FILE *f, FDSet *fds, bool switching_root)
; | |
| | | | |
End of changes. 8 change blocks. |
| 6 lines changed or deleted | | 13 lines changed or added | |
|
| sd-bus.h | | sd-bus.h | |
| | | | |
| skipping to change at line 30 | | skipping to change at line 30 | |
| | | | |
| You should have received a copy of the GNU Lesser General Public License | | You should have received a copy of the GNU Lesser General Public License | |
| along with systemd; If not, see <http://www.gnu.org/licenses/>. | | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
| ***/ | | ***/ | |
| | | | |
| #include <inttypes.h> | | #include <inttypes.h> | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| | | | |
| #include <sd-id128.h> | | #include <sd-id128.h> | |
| #include "sd-bus-protocol.h" | | #include "sd-bus-protocol.h" | |
|
| | | #include "sd-memfd.h" | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| #ifndef _sd_printf_attr_ | | #ifndef _sd_printf_attr_ | |
| # if __GNUC__ >= 4 | | # if __GNUC__ >= 4 | |
| # define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) | | # define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) | |
| # else | | # else | |
| # define _sd_printf_attr_(a,b) | | # define _sd_printf_attr_(a,b) | |
| # endif | | # endif | |
| #endif | | #endif | |
| | | | |
|
| /* TODO: | | | |
| * - add page donation logic | | | |
| * - api for appending/reading fixed arrays | | | |
| * - merge busctl into systemctl or so? | | | |
| * - default policy (allow uid == 0 and our own uid) | | | |
| * | | | |
| * - enforce alignment of pointers passed in | | | |
| * - negotiation for attach attributes | | | |
| * | | | |
| * - for kernel and unix transports allow setting the unix user/access mode | | | |
| for the node | | | |
| */ | | | |
| | | | |
| typedef struct sd_bus sd_bus; | | typedef struct sd_bus sd_bus; | |
| typedef struct sd_bus_message sd_bus_message; | | typedef struct sd_bus_message sd_bus_message; | |
| | | | |
| typedef struct { | | typedef struct { | |
| const char *name; | | const char *name; | |
| const char *message; | | const char *message; | |
| int need_free; | | int need_free; | |
| } sd_bus_error; | | } sd_bus_error; | |
| | | | |
|
| typedef int (*sd_bus_message_handler_t)(sd_bus *bus, int ret, sd_bus_messag
e *m, void *userdata); | | typedef int (*sd_bus_message_handler_t)(sd_bus *bus, sd_bus_message *m, voi
d *userdata); | |
| | | | |
| /* Connections */ | | /* Connections */ | |
| | | | |
| int sd_bus_open_system(sd_bus **ret); | | int sd_bus_open_system(sd_bus **ret); | |
| int sd_bus_open_user(sd_bus **ret); | | int sd_bus_open_user(sd_bus **ret); | |
| | | | |
| int sd_bus_new(sd_bus **ret); | | int sd_bus_new(sd_bus **ret); | |
| int sd_bus_set_address(sd_bus *bus, const char *address); | | int sd_bus_set_address(sd_bus *bus, const char *address); | |
| int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd); | | int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd); | |
| int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]); | | int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]); | |
| int sd_bus_set_bus_client(sd_bus *bus, int b); | | int sd_bus_set_bus_client(sd_bus *bus, int b); | |
| int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t server_id); | | int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t server_id); | |
| int sd_bus_set_anonymous(sd_bus *bus, int b); | | int sd_bus_set_anonymous(sd_bus *bus, int b); | |
|
| int sd_bus_set_negotiate_fds(sd_bus *bus, int b); | | int sd_bus_negotiate_fds(sd_bus *bus, int b); | |
| | | int sd_bus_negotiate_attach_comm(sd_bus *bus, int b); | |
| | | int sd_bus_negotiate_attach_exe(sd_bus *bus, int b); | |
| | | int sd_bus_negotiate_attach_cmdline(sd_bus *bus, int b); | |
| | | int sd_bus_negotiate_attach_cgroup(sd_bus *bus, int b); | |
| | | int sd_bus_negotiate_attach_caps(sd_bus *bus, int b); | |
| | | int sd_bus_negotiate_attach_selinux_context(sd_bus *bus, int b); | |
| | | int sd_bus_negotiate_attach_audit(sd_bus *bus, int b); | |
| int sd_bus_start(sd_bus *ret); | | int sd_bus_start(sd_bus *ret); | |
| | | | |
| void sd_bus_close(sd_bus *bus); | | void sd_bus_close(sd_bus *bus); | |
| | | | |
| sd_bus *sd_bus_ref(sd_bus *bus); | | sd_bus *sd_bus_ref(sd_bus *bus); | |
| sd_bus *sd_bus_unref(sd_bus *bus); | | sd_bus *sd_bus_unref(sd_bus *bus); | |
| | | | |
| int sd_bus_is_open(sd_bus *bus); | | int sd_bus_is_open(sd_bus *bus); | |
| int sd_bus_can_send(sd_bus *bus, char type); | | int sd_bus_can_send(sd_bus *bus, char type); | |
| int sd_bus_get_server_id(sd_bus *bus, sd_id128_t *peer); | | int sd_bus_get_server_id(sd_bus *bus, sd_id128_t *peer); | |
| | | | |
| skipping to change at line 166 | | skipping to change at line 162 | |
| | | | |
| int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, cons
t char *member); | | int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, cons
t char *member); | |
| int sd_bus_message_is_method_call(sd_bus_message *m, const char *interface,
const char *member); | | int sd_bus_message_is_method_call(sd_bus_message *m, const char *interface,
const char *member); | |
| int sd_bus_message_is_method_error(sd_bus_message *m, const char *name); | | int sd_bus_message_is_method_error(sd_bus_message *m, const char *name); | |
| | | | |
| int sd_bus_message_set_no_reply(sd_bus_message *m, int b); | | int sd_bus_message_set_no_reply(sd_bus_message *m, int b); | |
| int sd_bus_message_set_destination(sd_bus_message *m, const char *destinati
on); | | int sd_bus_message_set_destination(sd_bus_message *m, const char *destinati
on); | |
| | | | |
| int sd_bus_message_append(sd_bus_message *m, const char *types, ...); | | int sd_bus_message_append(sd_bus_message *m, const char *types, ...); | |
| int sd_bus_message_append_basic(sd_bus_message *m, char type, const void *p
); | | int sd_bus_message_append_basic(sd_bus_message *m, char type, const void *p
); | |
|
| | | int sd_bus_message_append_array(sd_bus_message *m, char type, const void *p | |
| | | tr, size_t size); | |
| | | int sd_bus_message_append_array_space(sd_bus_message *m, char type, size_t | |
| | | size, void **ptr); | |
| | | int sd_bus_message_append_array_memfd(sd_bus_message *m, char type, sd_memf | |
| | | d *memfd); | |
| | | int sd_bus_message_append_string_space(sd_bus_message *m, size_t size, char | |
| | | **s); | |
| | | int sd_bus_message_append_string_memfd(sd_bus_message *m, sd_memfd* memfd); | |
| int sd_bus_message_open_container(sd_bus_message *m, char type, const char
*contents); | | int sd_bus_message_open_container(sd_bus_message *m, char type, const char
*contents); | |
| int sd_bus_message_close_container(sd_bus_message *m); | | int sd_bus_message_close_container(sd_bus_message *m); | |
| | | | |
| int sd_bus_message_read(sd_bus_message *m, const char *types, ...); | | int sd_bus_message_read(sd_bus_message *m, const char *types, ...); | |
| int sd_bus_message_read_basic(sd_bus_message *m, char type, void *p); | | int sd_bus_message_read_basic(sd_bus_message *m, char type, void *p); | |
|
| | | int sd_bus_message_read_array(sd_bus_message *m, char type, const void **pt
r, size_t *size); | |
| int sd_bus_message_enter_container(sd_bus_message *m, char type, const char
*contents); | | int sd_bus_message_enter_container(sd_bus_message *m, char type, const char
*contents); | |
| int sd_bus_message_exit_container(sd_bus_message *m); | | int sd_bus_message_exit_container(sd_bus_message *m); | |
| int sd_bus_message_peek_type(sd_bus_message *m, char *type, const char **co
ntents); | | int sd_bus_message_peek_type(sd_bus_message *m, char *type, const char **co
ntents); | |
| int sd_bus_message_rewind(sd_bus_message *m, int complete); | | int sd_bus_message_rewind(sd_bus_message *m, int complete); | |
| | | | |
| /* Convenience calls */ | | /* Convenience calls */ | |
| | | | |
| int sd_bus_emit_signal(sd_bus *bus, const char *path, const char *interface
, const char *member, const char *types, ...); | | int sd_bus_emit_signal(sd_bus *bus, const char *path, const char *interface
, const char *member, const char *types, ...); | |
| int sd_bus_call_method(sd_bus *bus, const char *destination, const char *pa
th, const char *interface, const char *member, sd_bus_error *error, sd_bus_
message **reply, const char *types, ...); | | int sd_bus_call_method(sd_bus *bus, const char *destination, const char *pa
th, const char *interface, const char *member, sd_bus_error *error, sd_bus_
message **reply, const char *types, ...); | |
| int sd_bus_reply_method_return(sd_bus *bus, sd_bus_message *call, const cha
r *types, ...); | | int sd_bus_reply_method_return(sd_bus *bus, sd_bus_message *call, const cha
r *types, ...); | |
| | | | |
| skipping to change at line 206 | | skipping to change at line 208 | |
| #define SD_BUS_ERROR_NULL ((sd_bus_error) {NULL, NULL, 0}) | | #define SD_BUS_ERROR_NULL ((sd_bus_error) {NULL, NULL, 0}) | |
| #define SD_BUS_ERROR_MAKE(name, message) ((sd_bus_error) {(name), (message)
, 0}) | | #define SD_BUS_ERROR_MAKE(name, message) ((sd_bus_error) {(name), (message)
, 0}) | |
| | | | |
| void sd_bus_error_free(sd_bus_error *e); | | void sd_bus_error_free(sd_bus_error *e); | |
| int sd_bus_error_set(sd_bus_error *e, const char *name, const char *format,
...) _sd_printf_attr_(3, 0); | | int sd_bus_error_set(sd_bus_error *e, const char *name, const char *format,
...) _sd_printf_attr_(3, 0); | |
| void sd_bus_error_set_const(sd_bus_error *e, const char *name, const char *
message); | | void sd_bus_error_set_const(sd_bus_error *e, const char *name, const char *
message); | |
| int sd_bus_error_copy(sd_bus_error *dest, const sd_bus_error *e); | | int sd_bus_error_copy(sd_bus_error *dest, const sd_bus_error *e); | |
| int sd_bus_error_is_set(const sd_bus_error *e); | | int sd_bus_error_is_set(const sd_bus_error *e); | |
| int sd_bus_error_has_name(const sd_bus_error *e, const char *name); | | int sd_bus_error_has_name(const sd_bus_error *e, const char *name); | |
| | | | |
|
| | | #define SD_BUS_APPEND_ID128(x) 16, | |
| | | \ | |
| | | (x).bytes[0], (x).bytes[1], (x).bytes[2], (x).bytes[3], | |
| | | \ | |
| | | (x).bytes[4], (x).bytes[5], (x).bytes[6], (x).bytes[7], | |
| | | \ | |
| | | (x).bytes[8], (x).bytes[9], (x).bytes[10], (x).bytes[11], | |
| | | \ | |
| | | (x).bytes[12], (x).bytes[13], (x).bytes[14], (x).bytes[15] | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 7 change blocks. |
| 15 lines changed or deleted | | 30 lines changed or added | |
|
| sd-messages.h | | sd-messages.h | |
| | | | |
| skipping to change at line 34 | | skipping to change at line 34 | |
| | | | |
| #include <systemd/sd-id128.h> | | #include <systemd/sd-id128.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /* Hey! If you add a new message here, you *must* also update the | | /* Hey! If you add a new message here, you *must* also update the | |
| * message catalog with an appropriate explanation */ | | * message catalog with an appropriate explanation */ | |
| | | | |
|
| | | /* And if you add a new ID here, make sure to generate a random one | |
| | | * with journalctl --new-id128. Do not use any other IDs, and do not | |
| | | * count them up manually. */ | |
| | | | |
| #define SD_MESSAGE_JOURNAL_START SD_ID128_MAKE(f7,73,79,a8,49,0b,40,8b,b
e,5f,69,40,50,5a,77,7b) | | #define SD_MESSAGE_JOURNAL_START SD_ID128_MAKE(f7,73,79,a8,49,0b,40,8b,b
e,5f,69,40,50,5a,77,7b) | |
| #define SD_MESSAGE_JOURNAL_STOP SD_ID128_MAKE(d9,3f,b3,c9,c2,4d,45,1a,9
7,ce,a6,15,ce,59,c0,0b) | | #define SD_MESSAGE_JOURNAL_STOP SD_ID128_MAKE(d9,3f,b3,c9,c2,4d,45,1a,9
7,ce,a6,15,ce,59,c0,0b) | |
| #define SD_MESSAGE_JOURNAL_DROPPED SD_ID128_MAKE(a5,96,d6,fe,7b,fa,49,94,8
2,8e,72,30,9e,95,d6,1e) | | #define SD_MESSAGE_JOURNAL_DROPPED SD_ID128_MAKE(a5,96,d6,fe,7b,fa,49,94,8
2,8e,72,30,9e,95,d6,1e) | |
| #define SD_MESSAGE_JOURNAL_MISSED SD_ID128_MAKE(e9,bf,28,e6,e8,34,48,1b,b
6,f4,8f,54,8a,d1,36,06) | | #define SD_MESSAGE_JOURNAL_MISSED SD_ID128_MAKE(e9,bf,28,e6,e8,34,48,1b,b
6,f4,8f,54,8a,d1,36,06) | |
|
| | | #define SD_MESSAGE_JOURNAL_USAGE SD_ID128_MAKE(ec,38,7f,57,7b,84,4b,8f,a
9,48,f3,3c,ad,9a,75,e6) | |
| | | | |
| #define SD_MESSAGE_COREDUMP SD_ID128_MAKE(fc,2e,22,bc,6e,e6,47,b6,b
9,07,29,ab,34,a2,50,b1) | | #define SD_MESSAGE_COREDUMP SD_ID128_MAKE(fc,2e,22,bc,6e,e6,47,b6,b
9,07,29,ab,34,a2,50,b1) | |
| | | | |
| #define SD_MESSAGE_SESSION_START SD_ID128_MAKE(8d,45,62,0c,1a,43,48,db,b
1,74,10,da,57,c6,0c,66) | | #define SD_MESSAGE_SESSION_START SD_ID128_MAKE(8d,45,62,0c,1a,43,48,db,b
1,74,10,da,57,c6,0c,66) | |
| #define SD_MESSAGE_SESSION_STOP SD_ID128_MAKE(33,54,93,94,24,b4,45,6d,9
8,02,ca,83,33,ed,42,4a) | | #define SD_MESSAGE_SESSION_STOP SD_ID128_MAKE(33,54,93,94,24,b4,45,6d,9
8,02,ca,83,33,ed,42,4a) | |
| #define SD_MESSAGE_SEAT_START SD_ID128_MAKE(fc,be,fc,5d,a2,3d,42,80,9
3,f9,7c,82,a9,29,0f,7b) | | #define SD_MESSAGE_SEAT_START SD_ID128_MAKE(fc,be,fc,5d,a2,3d,42,80,9
3,f9,7c,82,a9,29,0f,7b) | |
| #define SD_MESSAGE_SEAT_STOP SD_ID128_MAKE(e7,85,2b,fe,46,78,4e,d0,a
c,cd,e0,4b,c8,64,c2,d5) | | #define SD_MESSAGE_SEAT_STOP SD_ID128_MAKE(e7,85,2b,fe,46,78,4e,d0,a
c,cd,e0,4b,c8,64,c2,d5) | |
|
| | | #define SD_MESSAGE_MACHINE_START SD_ID128_MAKE(24,d8,d4,45,25,73,40,24,9 | |
| | | 6,06,83,81,a6,31,2d,f2) | |
| | | #define SD_MESSAGE_MACHINE_STOP SD_ID128_MAKE(58,43,2b,d3,ba,ce,47,7c,b | |
| | | 5,14,b5,63,81,b8,a7,58) | |
| | | | |
| #define SD_MESSAGE_TIME_CHANGE SD_ID128_MAKE(c7,a7,87,07,9b,35,4e,aa,a
9,e7,7b,37,18,93,cd,27) | | #define SD_MESSAGE_TIME_CHANGE SD_ID128_MAKE(c7,a7,87,07,9b,35,4e,aa,a
9,e7,7b,37,18,93,cd,27) | |
| #define SD_MESSAGE_TIMEZONE_CHANGE SD_ID128_MAKE(45,f8,2f,4a,ef,7a,4b,bf,9
4,2c,e8,61,d1,f2,09,90) | | #define SD_MESSAGE_TIMEZONE_CHANGE SD_ID128_MAKE(45,f8,2f,4a,ef,7a,4b,bf,9
4,2c,e8,61,d1,f2,09,90) | |
| | | | |
| #define SD_MESSAGE_STARTUP_FINISHED SD_ID128_MAKE(b0,7a,24,9c,d0,24,41,4a,8
2,dd,00,cd,18,13,78,ff) | | #define SD_MESSAGE_STARTUP_FINISHED SD_ID128_MAKE(b0,7a,24,9c,d0,24,41,4a,8
2,dd,00,cd,18,13,78,ff) | |
| | | | |
| #define SD_MESSAGE_SLEEP_START SD_ID128_MAKE(6b,bd,95,ee,97,79,41,e4,9
7,c4,8b,e2,7c,25,41,28) | | #define SD_MESSAGE_SLEEP_START SD_ID128_MAKE(6b,bd,95,ee,97,79,41,e4,9
7,c4,8b,e2,7c,25,41,28) | |
| #define SD_MESSAGE_SLEEP_STOP SD_ID128_MAKE(88,11,e6,df,2a,8e,40,f5,8
a,94,ce,a2,6f,8e,bf,14) | | #define SD_MESSAGE_SLEEP_STOP SD_ID128_MAKE(88,11,e6,df,2a,8e,40,f5,8
a,94,ce,a2,6f,8e,bf,14) | |
| | | | |
| #define SD_MESSAGE_SHUTDOWN SD_ID128_MAKE(98,26,88,66,d1,d5,4a,49,9
c,4e,98,92,1d,93,bc,40) | | #define SD_MESSAGE_SHUTDOWN SD_ID128_MAKE(98,26,88,66,d1,d5,4a,49,9
c,4e,98,92,1d,93,bc,40) | |
| | | | |
End of changes. 3 change blocks. |
| 0 lines changed or deleted | | 9 lines changed or added | |
|
| unit.h | | unit.h | |
| | | | |
| skipping to change at line 40 | | skipping to change at line 40 | |
| typedef enum UnitActiveState UnitActiveState; | | typedef enum UnitActiveState UnitActiveState; | |
| typedef enum UnitDependency UnitDependency; | | typedef enum UnitDependency UnitDependency; | |
| typedef struct UnitRef UnitRef; | | typedef struct UnitRef UnitRef; | |
| typedef struct UnitStatusMessageFormats UnitStatusMessageFormats; | | typedef struct UnitStatusMessageFormats UnitStatusMessageFormats; | |
| | | | |
| #include "set.h" | | #include "set.h" | |
| #include "util.h" | | #include "util.h" | |
| #include "list.h" | | #include "list.h" | |
| #include "socket-util.h" | | #include "socket-util.h" | |
| #include "execute.h" | | #include "execute.h" | |
|
| | | #include "cgroup.h" | |
| #include "condition.h" | | #include "condition.h" | |
| #include "install.h" | | #include "install.h" | |
| #include "unit-name.h" | | #include "unit-name.h" | |
|
| #include "cgroup-semantics.h" | | | |
| | | | |
| enum UnitActiveState { | | enum UnitActiveState { | |
| UNIT_ACTIVE, | | UNIT_ACTIVE, | |
| UNIT_RELOADING, | | UNIT_RELOADING, | |
| UNIT_INACTIVE, | | UNIT_INACTIVE, | |
| UNIT_FAILED, | | UNIT_FAILED, | |
| UNIT_ACTIVATING, | | UNIT_ACTIVATING, | |
| UNIT_DEACTIVATING, | | UNIT_DEACTIVATING, | |
| _UNIT_ACTIVE_STATE_MAX, | | _UNIT_ACTIVE_STATE_MAX, | |
| _UNIT_ACTIVE_STATE_INVALID = -1 | | _UNIT_ACTIVE_STATE_INVALID = -1 | |
| | | | |
| skipping to change at line 118 | | skipping to change at line 118 | |
| /* Reference information for GC logic */ | | /* Reference information for GC logic */ | |
| UNIT_REFERENCES, /* Inverse of 'references' is 'refere
nced_by' */ | | UNIT_REFERENCES, /* Inverse of 'references' is 'refere
nced_by' */ | |
| UNIT_REFERENCED_BY, | | UNIT_REFERENCED_BY, | |
| | | | |
| _UNIT_DEPENDENCY_MAX, | | _UNIT_DEPENDENCY_MAX, | |
| _UNIT_DEPENDENCY_INVALID = -1 | | _UNIT_DEPENDENCY_INVALID = -1 | |
| }; | | }; | |
| | | | |
| #include "manager.h" | | #include "manager.h" | |
| #include "job.h" | | #include "job.h" | |
|
| #include "cgroup.h" | | | |
| #include "cgroup-attr.h" | | struct UnitRef { | |
| | | /* Keeps tracks of references to a unit. This is useful so | |
| | | * that we can merge two units if necessary and correct all | |
| | | * references to them */ | |
| | | | |
| | | Unit* unit; | |
| | | LIST_FIELDS(UnitRef, refs); | |
| | | }; | |
| | | | |
| struct Unit { | | struct Unit { | |
| Manager *manager; | | Manager *manager; | |
| | | | |
| UnitType type; | | UnitType type; | |
| UnitLoadState load_state; | | UnitLoadState load_state; | |
| Unit *merged_into; | | Unit *merged_into; | |
| | | | |
| char *id; /* One name is special because we use it for identificati
on. Points to an entry in the names set */ | | char *id; /* One name is special because we use it for identificati
on. Points to an entry in the names set */ | |
| char *instance; | | char *instance; | |
| | | | |
| skipping to change at line 168 | | skipping to change at line 175 | |
| LIST_HEAD(Condition, conditions); | | LIST_HEAD(Condition, conditions); | |
| | | | |
| dual_timestamp condition_timestamp; | | dual_timestamp condition_timestamp; | |
| | | | |
| dual_timestamp inactive_exit_timestamp; | | dual_timestamp inactive_exit_timestamp; | |
| dual_timestamp active_enter_timestamp; | | dual_timestamp active_enter_timestamp; | |
| dual_timestamp active_exit_timestamp; | | dual_timestamp active_exit_timestamp; | |
| dual_timestamp inactive_enter_timestamp; | | dual_timestamp inactive_enter_timestamp; | |
| | | | |
| /* Counterparts in the cgroup filesystem */ | | /* Counterparts in the cgroup filesystem */ | |
|
| CGroupBonding *cgroup_bondings; | | char *cgroup_path; | |
| CGroupAttribute *cgroup_attributes; | | bool cgroup_realized; | |
| | | CGroupControllerMask cgroup_mask; | |
| | | | |
| | | UnitRef slice; | |
| | | | |
| /* Per type list */ | | /* Per type list */ | |
| LIST_FIELDS(Unit, units_by_type); | | LIST_FIELDS(Unit, units_by_type); | |
| | | | |
| /* All units which have requires_mounts_for set */ | | /* All units which have requires_mounts_for set */ | |
| LIST_FIELDS(Unit, has_requires_mounts_for); | | LIST_FIELDS(Unit, has_requires_mounts_for); | |
| | | | |
| /* Load queue */ | | /* Load queue */ | |
| LIST_FIELDS(Unit, load_queue); | | LIST_FIELDS(Unit, load_queue); | |
| | | | |
| /* D-Bus queue */ | | /* D-Bus queue */ | |
| LIST_FIELDS(Unit, dbus_queue); | | LIST_FIELDS(Unit, dbus_queue); | |
| | | | |
| /* Cleanup queue */ | | /* Cleanup queue */ | |
| LIST_FIELDS(Unit, cleanup_queue); | | LIST_FIELDS(Unit, cleanup_queue); | |
| | | | |
| /* GC queue */ | | /* GC queue */ | |
| LIST_FIELDS(Unit, gc_queue); | | LIST_FIELDS(Unit, gc_queue); | |
| | | | |
|
| | | /* CGroup realize members queue */ | |
| | | LIST_FIELDS(Unit, cgroup_queue); | |
| | | | |
| /* Used during GC sweeps */ | | /* Used during GC sweeps */ | |
| unsigned gc_marker; | | unsigned gc_marker; | |
| | | | |
| /* When deserializing, temporarily store the job type for this | | /* When deserializing, temporarily store the job type for this | |
| * unit here, if there was a job scheduled. | | * unit here, if there was a job scheduled. | |
| * Only for deserializing from a legacy version. New style uses ful
l | | * Only for deserializing from a legacy version. New style uses ful
l | |
| * serialized jobs. */ | | * serialized jobs. */ | |
| int deserialized_job; /* This is actually of type JobType */ | | int deserialized_job; /* This is actually of type JobType */ | |
| | | | |
| /* Error code when we didn't manage to load the unit (negative) */ | | /* Error code when we didn't manage to load the unit (negative) */ | |
| | | | |
| skipping to change at line 231 | | skipping to change at line 244 | |
| | | | |
| /* Ignore this unit when isolating */ | | /* Ignore this unit when isolating */ | |
| bool ignore_on_isolate; | | bool ignore_on_isolate; | |
| | | | |
| /* Ignore this unit when snapshotting */ | | /* Ignore this unit when snapshotting */ | |
| bool ignore_on_snapshot; | | bool ignore_on_snapshot; | |
| | | | |
| /* Did the last condition check succeed? */ | | /* Did the last condition check succeed? */ | |
| bool condition_result; | | bool condition_result; | |
| | | | |
|
| | | /* Is this a transient unit? */ | |
| | | bool transient; | |
| | | | |
| bool in_load_queue:1; | | bool in_load_queue:1; | |
| bool in_dbus_queue:1; | | bool in_dbus_queue:1; | |
| bool in_cleanup_queue:1; | | bool in_cleanup_queue:1; | |
| bool in_gc_queue:1; | | bool in_gc_queue:1; | |
|
| | | bool in_cgroup_queue:1; | |
| | | | |
| bool sent_dbus_new_signal:1; | | bool sent_dbus_new_signal:1; | |
| | | | |
| bool no_gc:1; | | bool no_gc:1; | |
| | | | |
| bool in_audit:1; | | bool in_audit:1; | |
| }; | | }; | |
| | | | |
|
| struct UnitRef { | | | |
| /* Keeps tracks of references to a unit. This is useful so | | | |
| * that we can merge two units if necessary and correct all | | | |
| * references to them */ | | | |
| | | | |
| Unit* unit; | | | |
| LIST_FIELDS(UnitRef, refs); | | | |
| }; | | | |
| | | | |
| struct UnitStatusMessageFormats { | | struct UnitStatusMessageFormats { | |
| const char *starting_stopping[2]; | | const char *starting_stopping[2]; | |
| const char *finished_start_job[_JOB_RESULT_MAX]; | | const char *finished_start_job[_JOB_RESULT_MAX]; | |
| const char *finished_stop_job[_JOB_RESULT_MAX]; | | const char *finished_stop_job[_JOB_RESULT_MAX]; | |
| }; | | }; | |
| | | | |
|
| | | typedef enum UnitSetPropertiesMode { | |
| | | UNIT_CHECK = 0, | |
| | | UNIT_RUNTIME = 1, | |
| | | UNIT_PERSISTENT = 2, | |
| | | } UnitSetPropertiesMode; | |
| | | | |
| #include "service.h" | | #include "service.h" | |
| #include "timer.h" | | #include "timer.h" | |
| #include "socket.h" | | #include "socket.h" | |
| #include "target.h" | | #include "target.h" | |
| #include "device.h" | | #include "device.h" | |
| #include "mount.h" | | #include "mount.h" | |
| #include "automount.h" | | #include "automount.h" | |
| #include "snapshot.h" | | #include "snapshot.h" | |
| #include "swap.h" | | #include "swap.h" | |
| #include "path.h" | | #include "path.h" | |
|
| | | #include "slice.h" | |
| | | #include "scope.h" | |
| | | | |
| struct UnitVTable { | | struct UnitVTable { | |
| /* How much memory does an object of this unit type need */ | | /* How much memory does an object of this unit type need */ | |
| size_t object_size; | | size_t object_size; | |
| | | | |
| /* If greater than 0, the offset into the object where | | /* If greater than 0, the offset into the object where | |
| * ExecContext is found, if the unit type has that */ | | * ExecContext is found, if the unit type has that */ | |
| size_t exec_context_offset; | | size_t exec_context_offset; | |
| | | | |
|
| /* The name of the section with the exec settings of ExecContext */ | | /* If greater than 0, the offset into the object where | |
| const char *exec_section; | | * CGroupContext is found, if the unit type has that */ | |
| | | size_t cgroup_context_offset; | |
| | | | |
| | | /* The name of the configuration file section with the private sett | |
| | | ings of this unit*/ | |
| | | const char *private_section; | |
| | | | |
| /* Config file sections this unit type understands, separated | | /* Config file sections this unit type understands, separated | |
| * by NUL chars */ | | * by NUL chars */ | |
| const char *sections; | | const char *sections; | |
| | | | |
| /* This should reset all type-specific variables. This should | | /* This should reset all type-specific variables. This should | |
| * not allocate memory, and is called with zero-initialized | | * not allocate memory, and is called with zero-initialized | |
| * data. It should hence only initialize variables that need | | * data. It should hence only initialize variables that need | |
| * to be set != 0. */ | | * to be set != 0. */ | |
| void (*init)(Unit *u); | | void (*init)(Unit *u); | |
| | | | |
| skipping to change at line 350 | | skipping to change at line 370 | |
| | | | |
| void (*fd_event)(Unit *u, int fd, uint32_t events, Watch *w); | | void (*fd_event)(Unit *u, int fd, uint32_t events, Watch *w); | |
| void (*sigchld_event)(Unit *u, pid_t pid, int code, int status); | | void (*sigchld_event)(Unit *u, pid_t pid, int code, int status); | |
| void (*timer_event)(Unit *u, uint64_t n_elapsed, Watch *w); | | void (*timer_event)(Unit *u, uint64_t n_elapsed, Watch *w); | |
| | | | |
| /* Reset failed state if we are in failed state */ | | /* Reset failed state if we are in failed state */ | |
| void (*reset_failed)(Unit *u); | | void (*reset_failed)(Unit *u); | |
| | | | |
| /* Called whenever any of the cgroups this unit watches for | | /* Called whenever any of the cgroups this unit watches for | |
| * ran empty */ | | * ran empty */ | |
|
| void (*cgroup_notify_empty)(Unit *u); | | void (*notify_cgroup_empty)(Unit *u); | |
| | | | |
| /* Called whenever a process of this unit sends us a message */ | | /* Called whenever a process of this unit sends us a message */ | |
| void (*notify_message)(Unit *u, pid_t pid, char **tags); | | void (*notify_message)(Unit *u, pid_t pid, char **tags); | |
| | | | |
| /* Called whenever a name this Unit registered for comes or | | /* Called whenever a name this Unit registered for comes or | |
| * goes away. */ | | * goes away. */ | |
| void (*bus_name_owner_change)(Unit *u, const char *name, const char
*old_owner, const char *new_owner); | | void (*bus_name_owner_change)(Unit *u, const char *name, const char
*old_owner, const char *new_owner); | |
| | | | |
| /* Called whenever a bus PID lookup finishes */ | | /* Called whenever a bus PID lookup finishes */ | |
| void (*bus_query_pid_done)(Unit *u, const char *name, pid_t pid); | | void (*bus_query_pid_done)(Unit *u, const char *name, pid_t pid); | |
| | | | |
| /* Called for each message received on the bus */ | | /* Called for each message received on the bus */ | |
| DBusHandlerResult (*bus_message_handler)(Unit *u, DBusConnection *c
, DBusMessage *message); | | DBusHandlerResult (*bus_message_handler)(Unit *u, DBusConnection *c
, DBusMessage *message); | |
| | | | |
|
| | | /* Called for each property that is being set */ | |
| | | int (*bus_set_property)(Unit *u, const char *name, DBusMessageIter | |
| | | *i, UnitSetPropertiesMode mode, DBusError *error); | |
| | | | |
| | | /* Called after at least one property got changed to apply the nece | |
| | | ssary change */ | |
| | | int (*bus_commit_properties)(Unit *u); | |
| | | | |
| /* Return the unit this unit is following */ | | /* Return the unit this unit is following */ | |
| Unit *(*following)(Unit *u); | | Unit *(*following)(Unit *u); | |
| | | | |
| /* Return the set of units that are following each other */ | | /* Return the set of units that are following each other */ | |
| int (*following_set)(Unit *u, Set **s); | | int (*following_set)(Unit *u, Set **s); | |
| | | | |
| /* Invoked each time a unit this unit is triggering changes | | /* Invoked each time a unit this unit is triggering changes | |
| * state or gains/loses a job */ | | * state or gains/loses a job */ | |
| void (*trigger_notify)(Unit *u, Unit *trigger); | | void (*trigger_notify)(Unit *u, Unit *trigger); | |
| | | | |
| | | | |
| skipping to change at line 406 | | skipping to change at line 432 | |
| UnitStatusMessageFormats status_message_formats; | | UnitStatusMessageFormats status_message_formats; | |
| | | | |
| /* Can units of this type have multiple names? */ | | /* Can units of this type have multiple names? */ | |
| bool no_alias:1; | | bool no_alias:1; | |
| | | | |
| /* Instances make no sense for this type */ | | /* Instances make no sense for this type */ | |
| bool no_instances:1; | | bool no_instances:1; | |
| | | | |
| /* Exclude from automatic gc */ | | /* Exclude from automatic gc */ | |
| bool no_gc:1; | | bool no_gc:1; | |
|
| | | | |
| | | /* True if transient units of this type are OK */ | |
| | | bool can_transient:1; | |
| }; | | }; | |
| | | | |
| extern const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX]; | | extern const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX]; | |
| | | | |
| #define UNIT_VTABLE(u) unit_vtable[(u)->type] | | #define UNIT_VTABLE(u) unit_vtable[(u)->type] | |
| | | | |
| /* For casting a unit into the various unit types */ | | /* For casting a unit into the various unit types */ | |
| #define DEFINE_CAST(UPPERCASE, MixedCase) \ | | #define DEFINE_CAST(UPPERCASE, MixedCase) \ | |
| static inline MixedCase* UPPERCASE(Unit *u) { \ | | static inline MixedCase* UPPERCASE(Unit *u) { \ | |
| if (_unlikely_(!u || u->type != UNIT_##UPPERCASE)) \ | | if (_unlikely_(!u || u->type != UNIT_##UPPERCASE)) \ | |
| | | | |
| skipping to change at line 436 | | skipping to change at line 465 | |
| DEFINE_CAST(SOCKET, Socket); | | DEFINE_CAST(SOCKET, Socket); | |
| DEFINE_CAST(TIMER, Timer); | | DEFINE_CAST(TIMER, Timer); | |
| DEFINE_CAST(SERVICE, Service); | | DEFINE_CAST(SERVICE, Service); | |
| DEFINE_CAST(TARGET, Target); | | DEFINE_CAST(TARGET, Target); | |
| DEFINE_CAST(DEVICE, Device); | | DEFINE_CAST(DEVICE, Device); | |
| DEFINE_CAST(MOUNT, Mount); | | DEFINE_CAST(MOUNT, Mount); | |
| DEFINE_CAST(AUTOMOUNT, Automount); | | DEFINE_CAST(AUTOMOUNT, Automount); | |
| DEFINE_CAST(SNAPSHOT, Snapshot); | | DEFINE_CAST(SNAPSHOT, Snapshot); | |
| DEFINE_CAST(SWAP, Swap); | | DEFINE_CAST(SWAP, Swap); | |
| DEFINE_CAST(PATH, Path); | | DEFINE_CAST(PATH, Path); | |
|
| | | DEFINE_CAST(SLICE, Slice); | |
| | | DEFINE_CAST(SCOPE, Scope); | |
| | | | |
| Unit *unit_new(Manager *m, size_t size); | | Unit *unit_new(Manager *m, size_t size); | |
| void unit_free(Unit *u); | | void unit_free(Unit *u); | |
| | | | |
| int unit_add_name(Unit *u, const char *name); | | int unit_add_name(Unit *u, const char *name); | |
| | | | |
| int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_re
ference); | | int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_re
ference); | |
| int unit_add_two_dependencies(Unit *u, UnitDependency d, UnitDependency e,
Unit *other, bool add_reference); | | int unit_add_two_dependencies(Unit *u, UnitDependency d, UnitDependency e,
Unit *other, bool add_reference); | |
| | | | |
| int unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name
, const char *filename, bool add_reference); | | int unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name
, const char *filename, bool add_reference); | |
| int unit_add_two_dependencies_by_name(Unit *u, UnitDependency d, UnitDepend
ency e, const char *name, const char *path, bool add_reference); | | int unit_add_two_dependencies_by_name(Unit *u, UnitDependency d, UnitDepend
ency e, const char *name, const char *path, bool add_reference); | |
| | | | |
| int unit_add_dependency_by_name_inverse(Unit *u, UnitDependency d, const ch
ar *name, const char *filename, bool add_reference); | | int unit_add_dependency_by_name_inverse(Unit *u, UnitDependency d, const ch
ar *name, const char *filename, bool add_reference); | |
| int unit_add_two_dependencies_by_name_inverse(Unit *u, UnitDependency d, Un
itDependency e, const char *name, const char *path, bool add_reference); | | int unit_add_two_dependencies_by_name_inverse(Unit *u, UnitDependency d, Un
itDependency e, const char *name, const char *path, bool add_reference); | |
| | | | |
| int unit_add_exec_dependencies(Unit *u, ExecContext *c); | | int unit_add_exec_dependencies(Unit *u, ExecContext *c); | |
| | | | |
|
| int unit_add_cgroup_from_text(Unit *u, const char *name, bool overwrite, CG | | | |
| roupBonding **ret); | | | |
| int unit_add_default_cgroups(Unit *u); | | | |
| CGroupBonding* unit_get_default_cgroup(Unit *u); | | | |
| int unit_add_cgroup_attribute(Unit *u, const CGroupSemantics *semantics, co | | | |
| nst char *controller, const char *name, const char *value, CGroupAttribute | | | |
| **ret); | | | |
| | | | |
| int unit_choose_id(Unit *u, const char *name); | | int unit_choose_id(Unit *u, const char *name); | |
| int unit_set_description(Unit *u, const char *description); | | int unit_set_description(Unit *u, const char *description); | |
| | | | |
| bool unit_check_gc(Unit *u); | | bool unit_check_gc(Unit *u); | |
| | | | |
| void unit_add_to_load_queue(Unit *u); | | void unit_add_to_load_queue(Unit *u); | |
| void unit_add_to_dbus_queue(Unit *u); | | void unit_add_to_dbus_queue(Unit *u); | |
| void unit_add_to_cleanup_queue(Unit *u); | | void unit_add_to_cleanup_queue(Unit *u); | |
| void unit_add_to_gc_queue(Unit *u); | | void unit_add_to_gc_queue(Unit *u); | |
| | | | |
| int unit_merge(Unit *u, Unit *other); | | int unit_merge(Unit *u, Unit *other); | |
| int unit_merge_by_name(Unit *u, const char *other); | | int unit_merge_by_name(Unit *u, const char *other); | |
| | | | |
| Unit *unit_follow_merge(Unit *u) _pure_; | | Unit *unit_follow_merge(Unit *u) _pure_; | |
| | | | |
| int unit_load_fragment_and_dropin(Unit *u); | | int unit_load_fragment_and_dropin(Unit *u); | |
| int unit_load_fragment_and_dropin_optional(Unit *u); | | int unit_load_fragment_and_dropin_optional(Unit *u); | |
| int unit_load(Unit *unit); | | int unit_load(Unit *unit); | |
| | | | |
|
| | | int unit_add_default_slice(Unit *u); | |
| | | | |
| const char *unit_description(Unit *u) _pure_; | | const char *unit_description(Unit *u) _pure_; | |
| | | | |
| bool unit_has_name(Unit *u, const char *name); | | bool unit_has_name(Unit *u, const char *name); | |
| | | | |
| UnitActiveState unit_active_state(Unit *u); | | UnitActiveState unit_active_state(Unit *u); | |
| | | | |
| const char* unit_sub_state_to_string(Unit *u); | | const char* unit_sub_state_to_string(Unit *u); | |
| | | | |
| void unit_dump(Unit *u, FILE *f, const char *prefix); | | void unit_dump(Unit *u, FILE *f, const char *prefix); | |
| | | | |
| | | | |
| skipping to change at line 539 | | skipping to change at line 567 | |
| int unit_coldplug(Unit *u); | | int unit_coldplug(Unit *u); | |
| | | | |
| void unit_status_printf(Unit *u, const char *status, const char *unit_statu
s_msg_format) _printf_attr_(3, 0); | | void unit_status_printf(Unit *u, const char *status, const char *unit_statu
s_msg_format) _printf_attr_(3, 0); | |
| | | | |
| bool unit_need_daemon_reload(Unit *u); | | bool unit_need_daemon_reload(Unit *u); | |
| | | | |
| void unit_reset_failed(Unit *u); | | void unit_reset_failed(Unit *u); | |
| | | | |
| Unit *unit_following(Unit *u); | | Unit *unit_following(Unit *u); | |
| | | | |
|
| | | const char *unit_slice_name(Unit *u); | |
| | | | |
| bool unit_stop_pending(Unit *u) _pure_; | | bool unit_stop_pending(Unit *u) _pure_; | |
| bool unit_inactive_or_pending(Unit *u) _pure_; | | bool unit_inactive_or_pending(Unit *u) _pure_; | |
| bool unit_active_or_pending(Unit *u); | | bool unit_active_or_pending(Unit *u); | |
| | | | |
| int unit_add_default_target_dependency(Unit *u, Unit *target); | | int unit_add_default_target_dependency(Unit *u, Unit *target); | |
| | | | |
| char *unit_default_cgroup_path(Unit *u); | | char *unit_default_cgroup_path(Unit *u); | |
| | | | |
| int unit_following_set(Unit *u, Set **s); | | int unit_following_set(Unit *u, Set **s); | |
| | | | |
| | | | |
| skipping to change at line 560 | | skipping to change at line 590 | |
| void unit_trigger_notify(Unit *u); | | void unit_trigger_notify(Unit *u); | |
| | | | |
| bool unit_condition_test(Unit *u); | | bool unit_condition_test(Unit *u); | |
| | | | |
| UnitFileState unit_get_unit_file_state(Unit *u); | | UnitFileState unit_get_unit_file_state(Unit *u); | |
| | | | |
| Unit* unit_ref_set(UnitRef *ref, Unit *u); | | Unit* unit_ref_set(UnitRef *ref, Unit *u); | |
| void unit_ref_unset(UnitRef *ref); | | void unit_ref_unset(UnitRef *ref); | |
| | | | |
| #define UNIT_DEREF(ref) ((ref).unit) | | #define UNIT_DEREF(ref) ((ref).unit) | |
|
| | | #define UNIT_ISSET(ref) (!!(ref).unit) | |
| | | | |
| int unit_add_one_mount_link(Unit *u, Mount *m); | | int unit_add_one_mount_link(Unit *u, Mount *m); | |
| int unit_add_mount_links(Unit *u); | | int unit_add_mount_links(Unit *u); | |
| | | | |
| int unit_exec_context_defaults(Unit *u, ExecContext *c); | | int unit_exec_context_defaults(Unit *u, ExecContext *c); | |
| | | | |
| ExecContext *unit_get_exec_context(Unit *u) _pure_; | | ExecContext *unit_get_exec_context(Unit *u) _pure_; | |
|
| | | CGroupContext *unit_get_cgroup_context(Unit *u) _pure_; | |
| | | | |
|
| int unit_write_drop_in(Unit *u, bool runtime, const char *name, const char | | int unit_write_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *nam | |
| *data); | | e, const char *data); | |
| int unit_remove_drop_in(Unit *u, bool runtime, const char *name); | | int unit_write_drop_in_private_section(Unit *u, UnitSetPropertiesMode mode, | |
| | | const char *name, const char *data); | |
| | | int unit_remove_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *na | |
| | | me); | |
| | | | |
| int unit_kill_context(Unit *u, KillContext *c, bool sigkill, pid_t main_pid
, pid_t control_pid, bool main_pid_alien); | | int unit_kill_context(Unit *u, KillContext *c, bool sigkill, pid_t main_pid
, pid_t control_pid, bool main_pid_alien); | |
| | | | |
|
| | | int unit_make_transient(Unit *u); | |
| | | | |
| const char *unit_active_state_to_string(UnitActiveState i) _const_; | | const char *unit_active_state_to_string(UnitActiveState i) _const_; | |
| UnitActiveState unit_active_state_from_string(const char *s) _pure_; | | UnitActiveState unit_active_state_from_string(const char *s) _pure_; | |
| | | | |
| const char *unit_dependency_to_string(UnitDependency i) _const_; | | const char *unit_dependency_to_string(UnitDependency i) _const_; | |
| UnitDependency unit_dependency_from_string(const char *s) _pure_; | | UnitDependency unit_dependency_from_string(const char *s) _pure_; | |
| | | | |
| /* Macros which append UNIT= or USER_UNIT= to the message */ | | /* Macros which append UNIT= or USER_UNIT= to the message */ | |
| | | | |
| #define log_full_unit(level, unit, ...) log_meta_object(level, __FILE__, __
LINE__, __func__, getpid() == 1 ? "UNIT=" : "USER_UNIT=", unit, __VA_ARGS__
) | | #define log_full_unit(level, unit, ...) log_meta_object(level, __FILE__, __
LINE__, __func__, getpid() == 1 ? "UNIT=" : "USER_UNIT=", unit, __VA_ARGS__
) | |
| #define log_debug_unit(unit, ...) log_full_unit(LOG_DEBUG, unit, __VA
_ARGS__) | | #define log_debug_unit(unit, ...) log_full_unit(LOG_DEBUG, unit, __VA
_ARGS__) | |
| | | | |
End of changes. 22 change blocks. |
| 28 lines changed or deleted | | 65 lines changed or added | |
|