acl-util.h | acl-util.h | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
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> | |||
int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry); | int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry); | |||
int calc_acl_mask_if_needed(acl_t *acl_p); | int calc_acl_mask_if_needed(acl_t *acl_p); | |||
int search_acl_groups(char*** dst, const char* path, bool* belong); | int search_acl_groups(char*** dst, const char* path, bool* belong); | |||
static inline void acl_freep(acl_t *acl) { | ||||
if (!*acl) | ||||
return; | ||||
acl_free(*acl); | ||||
} | ||||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
ask-password-api.h | ask-password-api.h | |||
---|---|---|---|---|
skipping to change at line 28 | skipping to change at line 28 | |||
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/>. | |||
***/ | ***/ | |||
#include "util.h" | #include "util.h" | |||
int ask_password_tty(const char *message, usec_t until, const char *flag_fi le, char **_passphrase); | int ask_password_tty(const char *message, usec_t until, const char *flag_fi le, char **_passphrase); | |||
int ask_password_agent(const char *message, const char *icon, usec_t until, | int ask_password_agent(const char *message, const char *icon, const char *i | |||
bool accept_cached, char ***_passphrases); | d, | |||
usec_t until, bool accept_cached, char ***_passphras | ||||
es); | ||||
int ask_password_auto(const char *message, const char *icon, usec_t until, | int ask_password_auto(const char *message, const char *icon, const char *id | |||
bool accept_cached, char ***_passphrases); | , | |||
usec_t until, bool accept_cached, char ***_passphrase | ||||
s); | ||||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 4 lines changed or added | |||
async.h | async.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/>. | |||
***/ | ***/ | |||
int asynchronous_job(void* (*func)(void *p), void *arg); | int asynchronous_job(void* (*func)(void *p), void *arg); | |||
int asynchronous_sync(void); | int asynchronous_sync(void); | |||
int asynchronous_close(int fd); | ||||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
audit.h | audit.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooaudithfoo | #pragma once | |||
#define fooaudithfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2010 Lennart Poettering | Copyright 2010 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. | |||
skipping to change at line 31 | 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 <sys/types.h> | #include <sys/types.h> | |||
#include "capability.h" | #include "capability.h" | |||
int audit_session_from_pid(pid_t pid, uint32_t *id); | int audit_session_from_pid(pid_t pid, uint32_t *id); | |||
int audit_loginuid_from_pid(pid_t pid, uid_t *uid); | int audit_loginuid_from_pid(pid_t pid, uid_t *uid); | |||
#endif | ||||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added | |||
auto_dev-ioctl.h | auto_dev-ioctl.h | |||
---|---|---|---|---|
skipping to change at line 121 | skipping to change at line 121 | |||
struct args_timeout timeout; | struct args_timeout timeout; | |||
struct args_requester requester; | struct args_requester requester; | |||
struct args_expire expire; | struct args_expire expire; | |||
struct args_askumount askumount; | struct args_askumount askumount; | |||
struct args_ismountpoint ismountpoint; | struct args_ismountpoint ismountpoint; | |||
}; | }; | |||
char path[0]; | char path[0]; | |||
}; | }; | |||
static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in) | static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in) { | |||
{ | ||||
memset(in, 0, sizeof(struct autofs_dev_ioctl)); | memset(in, 0, sizeof(struct autofs_dev_ioctl)); | |||
in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR; | in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR; | |||
in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR; | in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR; | |||
in->size = sizeof(struct autofs_dev_ioctl); | in->size = sizeof(struct autofs_dev_ioctl); | |||
in->ioctlfd = -1; | in->ioctlfd = -1; | |||
return; | return; | |||
} | } | |||
/* | /* | |||
* If you change this make sure you make the corresponding change | * If you change this make sure you make the corresponding change | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added | |||
automount.h | automount.h | |||
---|---|---|---|---|
skipping to change at line 52 | skipping to change at line 52 | |||
} AutomountResult; | } AutomountResult; | |||
struct Automount { | struct Automount { | |||
Unit meta; | Unit meta; | |||
AutomountState state, deserialized_state; | AutomountState state, deserialized_state; | |||
char *where; | char *where; | |||
int pipe_fd; | int pipe_fd; | |||
sd_event_source *pipe_event_source; | ||||
mode_t directory_mode; | mode_t directory_mode; | |||
Watch pipe_watch; | ||||
dev_t dev_id; | dev_t dev_id; | |||
Set *tokens; | Set *tokens; | |||
AutomountResult result; | AutomountResult result; | |||
}; | }; | |||
extern const UnitVTable automount_vtable; | extern const UnitVTable automount_vtable; | |||
int automount_send_ready(Automount *a, int status); | int automount_send_ready(Automount *a, int status); | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
bootchart.h | bootchart.h | |||
---|---|---|---|---|
skipping to change at line 80 | skipping to change at line 80 | |||
struct ps_struct { | struct ps_struct { | |||
struct ps_struct *next_ps; /* SLL pointer */ | struct ps_struct *next_ps; /* SLL pointer */ | |||
struct ps_struct *parent; /* ppid ref */ | struct ps_struct *parent; /* ppid ref */ | |||
struct ps_struct *children; /* children */ | struct ps_struct *children; /* children */ | |||
struct ps_struct *next; /* siblings */ | struct ps_struct *next; /* siblings */ | |||
/* must match - otherwise it's a new process with same PID */ | /* must match - otherwise it's a new process with same PID */ | |||
char name[256]; | char name[256]; | |||
int pid; | int pid; | |||
int ppid; | int ppid; | |||
char *cgroup; | ||||
/* cache fd's */ | /* cache fd's */ | |||
int sched; | int sched; | |||
int schedstat; | int schedstat; | |||
FILE *smaps; | FILE *smaps; | |||
/* pointers to first/last seen timestamps */ | /* pointers to first/last seen timestamps */ | |||
struct ps_sched_struct *first; | struct ps_sched_struct *first; | |||
struct ps_sched_struct *last; | struct ps_sched_struct *last; | |||
skipping to change at line 117 | skipping to change at line 118 | |||
extern double graph_start; | extern double graph_start; | |||
extern double log_start; | extern double log_start; | |||
extern double sampletime[]; | extern double sampletime[]; | |||
extern struct ps_struct *ps_first; | extern struct ps_struct *ps_first; | |||
extern struct block_stat_struct blockstat[]; | extern struct block_stat_struct blockstat[]; | |||
extern int pscount; | extern int pscount; | |||
extern bool arg_relative; | extern bool arg_relative; | |||
extern bool arg_filter; | extern bool arg_filter; | |||
extern bool arg_show_cmdline; | extern bool arg_show_cmdline; | |||
extern bool arg_show_cgroup; | ||||
extern bool arg_pss; | extern bool arg_pss; | |||
extern bool arg_entropy; | extern bool arg_entropy; | |||
extern bool initcall; | extern bool initcall; | |||
extern int samples; | extern int samples; | |||
extern int cpus; | extern int cpus; | |||
extern int arg_samples_len; | extern int arg_samples_len; | |||
extern double arg_hz; | extern double arg_hz; | |||
extern double arg_scale_x; | extern double arg_scale_x; | |||
extern double arg_scale_y; | extern double arg_scale_y; | |||
extern int overrun; | extern int overrun; | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 2 lines changed or added | |||
build.h | build.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/>. | |||
***/ | ***/ | |||
#ifdef HAVE_PAM | #ifdef HAVE_PAM | |||
#define _PAM_FEATURE_ "+PAM" | #define _PAM_FEATURE_ "+PAM" | |||
#else | #else | |||
#define _PAM_FEATURE_ "-PAM" | #define _PAM_FEATURE_ "-PAM" | |||
#endif | #endif | |||
#ifdef HAVE_LIBWRAP | ||||
#define _LIBWRAP_FEATURE_ "+LIBWRAP" | ||||
#else | ||||
#define _LIBWRAP_FEATURE_ "-LIBWRAP" | ||||
#endif | ||||
#ifdef HAVE_AUDIT | #ifdef HAVE_AUDIT | |||
#define _AUDIT_FEATURE_ "+AUDIT" | #define _AUDIT_FEATURE_ "+AUDIT" | |||
#else | #else | |||
#define _AUDIT_FEATURE_ "-AUDIT" | #define _AUDIT_FEATURE_ "-AUDIT" | |||
#endif | #endif | |||
#ifdef HAVE_SELINUX | #ifdef HAVE_SELINUX | |||
#define _SELINUX_FEATURE_ "+SELINUX" | #define _SELINUX_FEATURE_ "+SELINUX" | |||
#else | #else | |||
#define _SELINUX_FEATURE_ "-SELINUX" | #define _SELINUX_FEATURE_ "-SELINUX" | |||
#endif | #endif | |||
#ifdef HAVE_APPARMOR | ||||
#define _APPARMOR_FEATURE_ "+APPARMOR" | ||||
#else | ||||
#define _APPARMOR_FEATURE_ "-APPARMOR" | ||||
#endif | ||||
#ifdef HAVE_IMA | #ifdef HAVE_IMA | |||
#define _IMA_FEATURE_ "+IMA" | #define _IMA_FEATURE_ "+IMA" | |||
#else | #else | |||
#define _IMA_FEATURE_ "-IMA" | #define _IMA_FEATURE_ "-IMA" | |||
#endif | #endif | |||
#ifdef HAVE_SYSV_COMPAT | #ifdef HAVE_SYSV_COMPAT | |||
#define _SYSVINIT_FEATURE_ "+SYSVINIT" | #define _SYSVINIT_FEATURE_ "+SYSVINIT" | |||
#else | #else | |||
#define _SYSVINIT_FEATURE_ "-SYSVINIT" | #define _SYSVINIT_FEATURE_ "-SYSVINIT" | |||
skipping to change at line 84 | skipping to change at line 84 | |||
#else | #else | |||
#define _ACL_FEATURE_ "-ACL" | #define _ACL_FEATURE_ "-ACL" | |||
#endif | #endif | |||
#ifdef HAVE_XZ | #ifdef HAVE_XZ | |||
#define _XZ_FEATURE_ "+XZ" | #define _XZ_FEATURE_ "+XZ" | |||
#else | #else | |||
#define _XZ_FEATURE_ "-XZ" | #define _XZ_FEATURE_ "-XZ" | |||
#endif | #endif | |||
#define SYSTEMD_FEATURES _PAM_FEATURE_ " " _LIBWRAP_FEATURE_ " " _AUDIT_FEA | #ifdef HAVE_SECCOMP | |||
TURE_ " " _SELINUX_FEATURE_ " " _IMA_FEATURE_ " " _SYSVINIT_FEATURE_ " " _L | #define _SECCOMP_FEATURE_ "+SECCOMP" | |||
IBCRYPTSETUP_FEATURE_ " " _GCRYPT_FEATURE_ " " _ACL_FEATURE_ " " _XZ_FEATUR | #else | |||
E_ | #define _SECCOMP_FEATURE_ "-SECCOMP" | |||
#endif | ||||
#define SYSTEMD_FEATURES _PAM_FEATURE_ " " _AUDIT_FEATURE_ " " _SELINUX_FEA | ||||
TURE_ " " _IMA_FEATURE_ " " _SYSVINIT_FEATURE_ " " _LIBCRYPTSETUP_FEATURE_ | ||||
" " _GCRYPT_FEATURE_ " " _ACL_FEATURE_ " " _XZ_FEATURE_ " " _SECCOMP_FEATUR | ||||
E_ " " _APPARMOR_FEATURE_ | ||||
End of changes. 3 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added | |||
bus-bloom.h | bus-bloom.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
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/>. | |||
***/ | ***/ | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#define BLOOM_SIZE 64 | /* | |||
* Our default bloom filter has the following parameters: | ||||
* | ||||
* m=512 (bits in the filter) | ||||
* k=8 (hash functions) | ||||
* | ||||
* We use SipHash24 as hash function with a number of (originally | ||||
* randomized) but fixed hash keys. | ||||
* | ||||
*/ | ||||
void bloom_add_data(uint64_t filter[BLOOM_SIZE/8], const void *data, size_t | #define DEFAULT_BLOOM_SIZE (512/8) /* m: filter size */ | |||
n); | #define DEFAULT_BLOOM_N_HASH 8 /* k: number of hash functions */ | |||
void bloom_add_pair(uint64_t filter[BLOOM_SIZE/8], const char *a, const cha | ||||
r *b); | void bloom_add_pair(uint64_t filter[], size_t size, unsigned n_hash, const | |||
void bloom_add_prefixes(uint64_t filter[BLOOM_SIZE/8], const char *a, const | char *a, const char *b); | |||
char *b, char sep); | void bloom_add_prefixes(uint64_t filter[], size_t size, unsigned n_hash, co | |||
nst char *a, const char *b, char sep); | ||||
bool bloom_validate_parameters(size_t size, unsigned n_hash); | ||||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 10 lines changed or added | |||
bus-control.h | bus-control.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/>. | |||
***/ | ***/ | |||
#include "sd-bus.h" | #include "sd-bus.h" | |||
#include "bus-match.h" | ||||
int bus_add_match_internal(sd_bus *bus, const char *match, struct bus_match _component *components, unsigned n_components, uint64_t cookie); | int bus_add_match_internal(sd_bus *bus, const char *match, struct bus_match _component *components, unsigned n_components, uint64_t cookie); | |||
int bus_remove_match_internal(sd_bus *bus, const char *match, uint64_t cook ie); | int bus_remove_match_internal(sd_bus *bus, const char *match, uint64_t cook ie); | |||
int bus_add_match_internal_kernel(sd_bus *bus, struct bus_match_component * | ||||
components, unsigned n_components, uint64_t cookie); | ||||
int bus_remove_match_internal_kernel(sd_bus *bus, uint64_t cookie); | ||||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
bus-error.h | bus-error.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | ||||
#include "sd-bus.h" | #include "sd-bus.h" | |||
#include "macro.h" | ||||
struct name_error_mapping { | ||||
const char* name; | ||||
int code; | ||||
}; | ||||
typedef struct name_error_mapping name_error_mapping; | ||||
int bus_error_to_errno(const sd_bus_error *e); | const name_error_mapping* bus_error_mapping_lookup(const char *str, unsigne | |||
int bus_error_from_errno(sd_bus_error *e, int error); | d int len); | |||
bool bus_error_is_dirty(sd_bus_error *e); | bool bus_error_is_dirty(sd_bus_error *e); | |||
const char *bus_error_message(const sd_bus_error *e, int error); | const char *bus_error_message(const sd_bus_error *e, int error); | |||
int bus_error_setfv(sd_bus_error *e, const char *name, const char *format, | ||||
va_list ap) _printf_(3,0); | ||||
int bus_error_set_errnofv(sd_bus_error *e, int error, const char *format, v | ||||
a_list ap) _printf_(3,0); | ||||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 11 lines changed or added | |||
bus-errors.h | bus-errors.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/>. | |||
***/ | ***/ | |||
#define BUS_ERROR_NO_SUCH_UNIT "org.freedesktop.systemd1.NoSuchUnit" | #define BUS_ERROR_NO_SUCH_UNIT "org.freedesktop.systemd1.NoSuchUnit" | |||
#define BUS_ERROR_NO_UNIT_FOR_PID "org.freedesktop.systemd1.NoUnitForPID" | ||||
#define BUS_ERROR_UNIT_EXISTS "org.freedesktop.systemd1.UnitExists" | ||||
#define BUS_ERROR_LOAD_FAILED "org.freedesktop.systemd1.LoadFailed" | ||||
#define BUS_ERROR_JOB_FAILED "org.freedesktop.systemd1.JobFailed" | ||||
#define BUS_ERROR_NO_SUCH_JOB "org.freedesktop.systemd1.NoSuchJob" | #define BUS_ERROR_NO_SUCH_JOB "org.freedesktop.systemd1.NoSuchJob" | |||
#define BUS_ERROR_NOT_SUBSCRIBED "org.freedesktop.systemd1.NotSubscribed" | #define BUS_ERROR_NOT_SUBSCRIBED "org.freedesktop.systemd1.NotSubscribed" | |||
#define BUS_ERROR_INVALID_PATH "org.freedesktop.systemd1.InvalidPath" | #define BUS_ERROR_ALREADY_SUBSCRIBED "org.freedesktop.systemd1.AlreadySubsc | |||
#define BUS_ERROR_INVALID_NAME "org.freedesktop.systemd1.InvalidName" | ribed" | |||
#define BUS_ERROR_UNIT_TYPE_MISMATCH "org.freedesktop.systemd1.UnitTypeMism | ||||
atch" | ||||
#define BUS_ERROR_UNIT_EXISTS "org.freedesktop.systemd1.UnitExists" | ||||
#define BUS_ERROR_NOT_SUPPORTED "org.freedesktop.systemd1.NotSupported" | ||||
#define BUS_ERROR_INVALID_JOB_MODE "org.freedesktop.systemd1.InvalidJobMode | ||||
" | ||||
#define BUS_ERROR_ONLY_BY_DEPENDENCY "org.freedesktop.systemd1.OnlyByDepend ency" | #define BUS_ERROR_ONLY_BY_DEPENDENCY "org.freedesktop.systemd1.OnlyByDepend ency" | |||
#define BUS_ERROR_NO_ISOLATION "org.freedesktop.systemd1.NoIsolation" | ||||
#define BUS_ERROR_LOAD_FAILED "org.freedesktop.systemd1.LoadFailed" | ||||
#define BUS_ERROR_MASKED "org.freedesktop.systemd1.Masked" | ||||
#define BUS_ERROR_JOB_TYPE_NOT_APPLICABLE "org.freedesktop.systemd1.JobType | ||||
NotApplicable" | ||||
#define BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE "org.freedesktop.systemd1.Tran | ||||
sactionIsDestructive" | ||||
#define BUS_ERROR_TRANSACTION_JOBS_CONFLICTING "org.freedesktop.systemd1.Tr ansactionJobsConflicting" | #define BUS_ERROR_TRANSACTION_JOBS_CONFLICTING "org.freedesktop.systemd1.Tr ansactionJobsConflicting" | |||
#define BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC "org.freedesktop.systemd1.Tra nsactionOrderIsCyclic" | #define BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC "org.freedesktop.systemd1.Tra nsactionOrderIsCyclic" | |||
#define BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE "org.freedesktop.systemd1.Tran | ||||
sactionIsDestructive" | ||||
#define BUS_ERROR_UNIT_MASKED "org.freedesktop.systemd1.UnitMasked" | ||||
#define BUS_ERROR_JOB_TYPE_NOT_APPLICABLE "org.freedesktop.systemd1.JobType | ||||
NotApplicable" | ||||
#define BUS_ERROR_NO_ISOLATION "org.freedesktop.systemd1.NoIsolation" | ||||
#define BUS_ERROR_SHUTTING_DOWN "org.freedesktop.systemd1.ShuttingDown" | #define BUS_ERROR_SHUTTING_DOWN "org.freedesktop.systemd1.ShuttingDown" | |||
#define BUS_ERROR_SCOPE_NOT_RUNNING "org.freedesktop.systemd1.ScopeNotRunni | ||||
ng" | ||||
#define BUS_ERROR_NO_SUCH_MACHINE "org.freedesktop.machine1.NoSuchMachine" | ||||
#define BUS_ERROR_NO_MACHINE_FOR_PID "org.freedesktop.machine1.NoMachineFor | ||||
PID" | ||||
#define BUS_ERROR_MACHINE_EXISTS "org.freedesktop.machine1.MachineExists" | ||||
#define BUS_ERROR_NO_PRIVATE_NETWORKING "org.freedesktop.machine1.NoPrivate | ||||
Networking" | ||||
#define BUS_ERROR_NO_SUCH_SESSION "org.freedesktop.login1.NoSuchSession" | ||||
#define BUS_ERROR_NO_SESSION_FOR_PID "org.freedesktop.login1.NoSessionForPI | ||||
D" | ||||
#define BUS_ERROR_NO_SUCH_USER "org.freedesktop.login1.NoSuchUser" | ||||
#define BUS_ERROR_NO_USER_FOR_PID "org.freedesktop.login1.NoUserForPID" | ||||
#define BUS_ERROR_NO_SUCH_SEAT "org.freedesktop.login1.NoSuchSeat" | ||||
#define BUS_ERROR_SESSION_NOT_ON_SEAT "org.freedesktop.login1.SessionNotOnS | ||||
eat" | ||||
#define BUS_ERROR_NOT_IN_CONTROL "org.freedesktop.login1.NotInControl" | ||||
#define BUS_ERROR_DEVICE_IS_TAKEN "org.freedesktop.login1.DeviceIsTaken" | ||||
#define BUS_ERROR_DEVICE_NOT_TAKEN "org.freedesktop.login1.DeviceNotTaken" | ||||
#define BUS_ERROR_OPERATION_IN_PROGRESS "org.freedesktop.login1.OperationIn | ||||
Progress" | ||||
#define BUS_ERROR_SLEEP_VERB_NOT_SUPPORTED "org.freedesktop.login1.SleepVer | ||||
bNotSupported" | ||||
#define BUS_ERROR_AUTOMATIC_TIME_SYNC_ENABLED "org.freedesktop.timedate1.Au | ||||
tomaticTimeSyncEnabled" | ||||
#define BUS_ERROR_NO_SUCH_PROCESS "org.freedesktop.systemd1.NoSuchProcess" | #define BUS_ERROR_NO_SUCH_PROCESS "org.freedesktop.systemd1.NoSuchProcess" | |||
#define BUS_ERROR_JOB_FAILED "org.freedesktop.systemd1.JobFailed" | ||||
End of changes. 7 change blocks. | ||||
16 lines changed or deleted | 42 lines changed or added | |||
bus-internal.h | bus-internal.h | |||
---|---|---|---|---|
skipping to change at line 39 | skipping to change at line 39 | |||
#include "hashmap.h" | #include "hashmap.h" | |||
#include "prioq.h" | #include "prioq.h" | |||
#include "list.h" | #include "list.h" | |||
#include "util.h" | #include "util.h" | |||
#include "refcnt.h" | #include "refcnt.h" | |||
#include "sd-bus.h" | #include "sd-bus.h" | |||
#include "bus-error.h" | #include "bus-error.h" | |||
#include "bus-match.h" | #include "bus-match.h" | |||
#include "bus-kernel.h" | #include "bus-kernel.h" | |||
#include "kdbus.h" | ||||
struct reply_callback { | struct reply_callback { | |||
sd_bus_message_handler_t callback; | sd_bus_message_handler_t callback; | |||
void *userdata; | ||||
usec_t timeout; | usec_t timeout; | |||
uint64_t serial; | uint64_t cookie; | |||
unsigned prioq_idx; | unsigned prioq_idx; | |||
}; | }; | |||
struct filter_callback { | struct filter_callback { | |||
sd_bus_message_handler_t callback; | sd_bus_message_handler_t callback; | |||
void *userdata; | ||||
unsigned last_iteration; | unsigned last_iteration; | |||
LIST_FIELDS(struct filter_callback, callbacks); | LIST_FIELDS(struct filter_callback, callbacks); | |||
}; | }; | |||
struct object_callback { | struct match_callback { | |||
sd_bus_message_handler_t callback; | sd_bus_message_handler_t callback; | |||
void *userdata; | ||||
uint64_t cookie; | ||||
unsigned last_iteration; | ||||
char *match_string; | ||||
struct bus_match_node *match_node; | ||||
}; | ||||
struct node { | ||||
char *path; | char *path; | |||
struct node *parent; | ||||
LIST_HEAD(struct node, child); | ||||
LIST_FIELDS(struct node, siblings); | ||||
LIST_HEAD(struct node_callback, callbacks); | ||||
LIST_HEAD(struct node_vtable, vtables); | ||||
LIST_HEAD(struct node_enumerator, enumerators); | ||||
LIST_HEAD(struct node_object_manager, object_managers); | ||||
}; | ||||
struct node_callback { | ||||
struct node *node; | ||||
bool is_fallback; | bool is_fallback; | |||
sd_bus_message_handler_t callback; | ||||
unsigned last_iteration; | ||||
LIST_FIELDS(struct node_callback, callbacks); | ||||
}; | ||||
struct node_enumerator { | ||||
struct node *node; | ||||
sd_bus_node_enumerator_t callback; | ||||
unsigned last_iteration; | unsigned last_iteration; | |||
LIST_FIELDS(struct node_enumerator, enumerators); | ||||
}; | ||||
struct node_object_manager { | ||||
struct node *node; | ||||
LIST_FIELDS(struct node_object_manager, object_managers); | ||||
}; | ||||
struct node_vtable { | ||||
struct node *node; | ||||
char *interface; | ||||
bool is_fallback; | ||||
const sd_bus_vtable *vtable; | ||||
sd_bus_object_find_t find; | ||||
unsigned last_iteration; | ||||
LIST_FIELDS(struct node_vtable, vtables); | ||||
}; | ||||
struct vtable_member { | ||||
const char *path; | ||||
const char *interface; | ||||
const char *member; | ||||
struct node_vtable *parent; | ||||
unsigned last_iteration; | ||||
const sd_bus_vtable *vtable; | ||||
}; | ||||
typedef enum BusSlotType { | ||||
BUS_REPLY_CALLBACK, | ||||
BUS_FILTER_CALLBACK, | ||||
BUS_MATCH_CALLBACK, | ||||
BUS_NODE_CALLBACK, | ||||
BUS_NODE_ENUMERATOR, | ||||
BUS_NODE_VTABLE, | ||||
BUS_NODE_OBJECT_MANAGER, | ||||
_BUS_SLOT_INVALID = -1, | ||||
} BusSlotType; | ||||
struct sd_bus_slot { | ||||
unsigned n_ref; | ||||
sd_bus *bus; | ||||
void *userdata; | ||||
BusSlotType type:5; | ||||
bool floating:1; | ||||
LIST_FIELDS(sd_bus_slot, slots); | ||||
union { | ||||
struct reply_callback reply_callback; | ||||
struct filter_callback filter_callback; | ||||
struct match_callback match_callback; | ||||
struct node_callback node_callback; | ||||
struct node_enumerator node_enumerator; | ||||
struct node_object_manager node_object_manager; | ||||
struct node_vtable node_vtable; | ||||
}; | ||||
}; | }; | |||
enum bus_state { | enum bus_state { | |||
BUS_UNSET, | BUS_UNSET, | |||
BUS_OPENING, | BUS_OPENING, | |||
BUS_AUTHENTICATING, | BUS_AUTHENTICATING, | |||
BUS_HELLO, | BUS_HELLO, | |||
BUS_RUNNING, | BUS_RUNNING, | |||
BUS_CLOSING, | ||||
BUS_CLOSED | BUS_CLOSED | |||
}; | }; | |||
static inline bool BUS_IS_OPEN(enum bus_state state) { | static inline bool BUS_IS_OPEN(enum bus_state state) { | |||
return state > BUS_UNSET && state < BUS_CLOSED; | return state > BUS_UNSET && state < BUS_CLOSING; | |||
} | } | |||
enum bus_auth { | enum bus_auth { | |||
_BUS_AUTH_INVALID, | _BUS_AUTH_INVALID, | |||
BUS_AUTH_EXTERNAL, | BUS_AUTH_EXTERNAL, | |||
BUS_AUTH_ANONYMOUS | BUS_AUTH_ANONYMOUS | |||
}; | }; | |||
struct sd_bus { | struct sd_bus { | |||
/* We use atomic ref counting here since sd_bus_message | /* We use atomic ref counting here since sd_bus_message | |||
skipping to change at line 100 | skipping to change at line 193 | |||
thread. We won't provide full thread safety, but only the | thread. We won't provide full thread safety, but only the | |||
bare minimum that makes it possible to use sd_bus and | bare minimum that makes it possible to use sd_bus and | |||
sd_bus_message objects independently and on different | sd_bus_message objects independently and on different | |||
threads as long as each object is used only once at the | threads as long as each object is used only once at the | |||
same time. */ | same time. */ | |||
RefCount n_ref; | RefCount n_ref; | |||
enum bus_state state; | enum bus_state state; | |||
int input_fd, output_fd; | int input_fd, output_fd; | |||
int message_version; | int message_version; | |||
int message_endian; | ||||
bool is_kernel:1; | bool is_kernel:1; | |||
bool can_fds:1; | bool can_fds:1; | |||
bool bus_client:1; | bool bus_client:1; | |||
bool ucred_valid:1; | bool ucred_valid:1; | |||
bool is_server:1; | bool is_server:1; | |||
bool anonymous_auth:1; | bool anonymous_auth:1; | |||
bool prefer_readv:1; | bool prefer_readv:1; | |||
bool prefer_writev:1; | bool prefer_writev:1; | |||
bool processing:1; | ||||
bool match_callbacks_modified:1; | bool match_callbacks_modified:1; | |||
bool filter_callbacks_modified:1; | bool filter_callbacks_modified:1; | |||
bool object_callbacks_modified:1; | bool nodes_modified:1; | |||
bool trusted:1; | ||||
bool fake_creds_valid:1; | ||||
bool manual_peer_interface:1; | ||||
bool is_system:1; | ||||
bool is_user:1; | ||||
int use_memfd; | int use_memfd; | |||
void *rbuffer; | void *rbuffer; | |||
size_t rbuffer_size; | size_t rbuffer_size; | |||
sd_bus_message **rqueue; | sd_bus_message **rqueue; | |||
unsigned rqueue_size; | unsigned rqueue_size; | |||
size_t rqueue_allocated; | ||||
sd_bus_message **wqueue; | sd_bus_message **wqueue; | |||
unsigned wqueue_size; | unsigned wqueue_size; | |||
size_t windex; | size_t windex; | |||
size_t wqueue_allocated; | ||||
uint64_t serial; | uint64_t cookie; | |||
char *unique_name; | char *unique_name; | |||
uint64_t unique_id; | ||||
struct bus_match_node match_callbacks; | struct bus_match_node match_callbacks; | |||
Prioq *reply_callbacks_prioq; | Prioq *reply_callbacks_prioq; | |||
Hashmap *reply_callbacks; | Hashmap *reply_callbacks; | |||
LIST_HEAD(struct filter_callback, filter_callbacks); | LIST_HEAD(struct filter_callback, filter_callbacks); | |||
Hashmap *object_callbacks; | ||||
Hashmap *nodes; | ||||
Hashmap *vtable_methods; | ||||
Hashmap *vtable_properties; | ||||
union { | union { | |||
struct sockaddr sa; | struct sockaddr sa; | |||
struct sockaddr_un un; | struct sockaddr_un un; | |||
struct sockaddr_in in; | struct sockaddr_in in; | |||
struct sockaddr_in6 in6; | struct sockaddr_in6 in6; | |||
} sockaddr; | } sockaddr; | |||
socklen_t sockaddr_size; | socklen_t sockaddr_size; | |||
char *kernel; | char *kernel; | |||
char *machine; | ||||
sd_id128_t server_id; | sd_id128_t server_id; | |||
char *address; | char *address; | |||
unsigned address_index; | unsigned address_index; | |||
int last_connect_error; | int last_connect_error; | |||
enum bus_auth auth; | enum bus_auth auth; | |||
size_t auth_rbegin; | size_t auth_rbegin; | |||
struct iovec auth_iovec[3]; | struct iovec auth_iovec[3]; | |||
unsigned auth_index; | unsigned auth_index; | |||
char *auth_buffer; | char *auth_buffer; | |||
usec_t auth_timeout; | usec_t auth_timeout; | |||
struct ucred ucred; | struct ucred ucred; | |||
char label[NAME_MAX]; | char label[NAME_MAX]; | |||
uint64_t creds_mask; | ||||
int *fds; | int *fds; | |||
unsigned n_fds; | unsigned n_fds; | |||
char *exec_path; | char *exec_path; | |||
char **exec_argv; | char **exec_argv; | |||
uint64_t hello_serial; | ||||
unsigned iteration_counter; | unsigned iteration_counter; | |||
void *kdbus_buffer; | void *kdbus_buffer; | |||
/* We do locking around the memfd cache, since we want to | /* We do locking around the memfd cache, since we want to | |||
* allow people to process a sd_bus_message in a different | * allow people to process a sd_bus_message in a different | |||
* thread then it was generated on and free it there. Since | * thread then it was generated on and free it there. Since | |||
* adding something to the memfd cache might happen when a | * adding something to the memfd cache might happen when a | |||
* message is released, we hence need to protect this bit with | * message is released, we hence need to protect this bit with | |||
* a mutex. */ | * a mutex. */ | |||
pthread_mutex_t memfd_cache_mutex; | pthread_mutex_t memfd_cache_mutex; | |||
struct memfd_cache memfd_cache[MEMFD_CACHE_MAX]; | struct memfd_cache memfd_cache[MEMFD_CACHE_MAX]; | |||
unsigned n_memfd_cache; | unsigned n_memfd_cache; | |||
pid_t original_pid; | pid_t original_pid; | |||
uint64_t hello_flags; | uint64_t hello_flags; | |||
uint64_t attach_flags; | ||||
uint64_t match_cookie; | uint64_t match_cookie; | |||
}; | ||||
static inline void bus_unrefp(sd_bus **b) { | sd_event_source *input_io_event_source; | |||
sd_bus_unref(*b); | sd_event_source *output_io_event_source; | |||
} | sd_event_source *time_event_source; | |||
sd_event_source *quit_event_source; | ||||
sd_event *event; | ||||
int event_priority; | ||||
#define _cleanup_bus_unref_ __attribute__((cleanup(bus_unrefp))) | sd_bus_message *current_message; | |||
#define _cleanup_bus_error_free_ __attribute__((cleanup(sd_bus_error_free)) | sd_bus_slot *current_slot; | |||
) | ||||
sd_bus **default_bus_ptr; | ||||
pid_t tid; | ||||
struct kdbus_creds fake_creds; | ||||
char *fake_label; | ||||
char *cgroup_root; | ||||
char *connection_name; | ||||
size_t bloom_size; | ||||
unsigned bloom_n_hash; | ||||
sd_bus_track *track_queue; | ||||
LIST_HEAD(sd_bus_slot, slots); | ||||
}; | ||||
#define BUS_DEFAULT_TIMEOUT ((usec_t) (25 * USEC_PER_SEC)) | #define BUS_DEFAULT_TIMEOUT ((usec_t) (25 * USEC_PER_SEC)) | |||
#define BUS_WQUEUE_MAX 128 | #define BUS_WQUEUE_MAX 1024 | |||
#define BUS_RQUEUE_MAX 128 | #define BUS_RQUEUE_MAX 64*1024 | |||
#define BUS_MESSAGE_SIZE_MAX (64*1024*1024) | #define BUS_MESSAGE_SIZE_MAX (64*1024*1024) | |||
#define BUS_AUTH_SIZE_MAX (64*1024) | #define BUS_AUTH_SIZE_MAX (64*1024) | |||
#define BUS_CONTAINER_DEPTH 128 | #define BUS_CONTAINER_DEPTH 128 | |||
/* Defined by the specification as maximum size of an array in | /* Defined by the specification as maximum size of an array in | |||
* bytes */ | * bytes */ | |||
#define BUS_ARRAY_MAX_SIZE 67108864 | #define BUS_ARRAY_MAX_SIZE 67108864 | |||
#define BUS_FDS_MAX 1024 | #define BUS_FDS_MAX 1024 | |||
#define BUS_EXEC_ARGV_MAX 256 | #define BUS_EXEC_ARGV_MAX 256 | |||
bool object_path_is_valid(const char *p); | bool interface_name_is_valid(const char *p) _pure_; | |||
bool interface_name_is_valid(const char *p); | bool service_name_is_valid(const char *p) _pure_; | |||
bool service_name_is_valid(const char *p); | bool member_name_is_valid(const char *p) _pure_; | |||
bool member_name_is_valid(const char *p); | bool object_path_is_valid(const char *p) _pure_; | |||
char *object_path_startswith(const char *a, const char *b) _pure_; | ||||
bool namespace_complex_pattern(const char *pattern, const char *value); | bool namespace_complex_pattern(const char *pattern, const char *value) _pur | |||
bool path_complex_pattern(const char *pattern, const char *value); | e_; | |||
bool path_complex_pattern(const char *pattern, const char *value) _pure_; | ||||
bool namespace_simple_pattern(const char *pattern, const char *value); | bool namespace_simple_pattern(const char *pattern, const char *value) _pure | |||
bool path_simple_pattern(const char *pattern, const char *value); | _; | |||
bool path_simple_pattern(const char *pattern, const char *value) _pure_; | ||||
int bus_message_type_from_string(const char *s, uint8_t *u); | int bus_message_type_from_string(const char *s, uint8_t *u) _pure_; | |||
const char *bus_message_type_to_string(uint8_t u); | const char *bus_message_type_to_string(uint8_t u) _pure_; | |||
#define error_name_is_valid interface_name_is_valid | #define error_name_is_valid interface_name_is_valid | |||
int bus_ensure_running(sd_bus *bus); | int bus_ensure_running(sd_bus *bus); | |||
int bus_start_running(sd_bus *bus); | int bus_start_running(sd_bus *bus); | |||
int bus_next_address(sd_bus *bus); | int bus_next_address(sd_bus *bus); | |||
int bus_seal_synthetic_message(sd_bus *b, sd_bus_message *m); | ||||
int bus_rqueue_make_room(sd_bus *bus); | ||||
bool bus_pid_changed(sd_bus *bus); | bool bus_pid_changed(sd_bus *bus); | |||
char *bus_address_escape(const char *v); | ||||
#define OBJECT_PATH_FOREACH_PREFIX(prefix, path) \ | ||||
for (char *_slash = ({ strcpy((prefix), (path)); streq((prefix), "/ | ||||
") ? NULL : strrchr((prefix), '/'); }) ; \ | ||||
_slash && !(_slash[(_slash) == (prefix)] = 0); \ | ||||
_slash = streq((prefix), "/") ? NULL : strrchr((prefix), '/')) | ||||
/* If we are invoking callbacks of a bus object, ensure unreffing the | ||||
* bus from the callback doesn't destroy the object we are working | ||||
* on */ | ||||
#define BUS_DONT_DESTROY(bus) \ | ||||
_cleanup_bus_unref_ _unused_ sd_bus *_dont_destroy_##bus = sd_bus_r | ||||
ef(bus) | ||||
int bus_set_address_system(sd_bus *bus); | ||||
int bus_set_address_user(sd_bus *bus); | ||||
int bus_set_address_system_remote(sd_bus *b, const char *host); | ||||
int bus_set_address_system_container(sd_bus *b, const char *machine); | ||||
int bus_remove_match_by_string(sd_bus *bus, const char *match, sd_bus_messa | ||||
ge_handler_t callback, void *userdata); | ||||
End of changes. 34 change blocks. | ||||
30 lines changed or deleted | 163 lines changed or added | |||
bus-kernel.h | bus-kernel.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | ||||
#include "busname.h" | ||||
#include "sd-bus.h" | #include "sd-bus.h" | |||
#define KDBUS_ITEM_NEXT(item) \ | #define KDBUS_ITEM_NEXT(item) \ | |||
(typeof(item))(((uint8_t *)item) + ALIGN8((item)->size)) | (typeof(item))(((uint8_t *)item) + ALIGN8((item)->size)) | |||
#define KDBUS_ITEM_FOREACH(item, head) | #define KDBUS_ITEM_FOREACH(part, head, first) \ | |||
\ | for (part = (head)->first; \ | |||
for (item = (head)->items; | ((uint8_t *)(part) < (uint8_t *)(head) + (head)->size) && \ | |||
\ | ((uint8_t *) part >= (uint8_t *) head); \ | |||
(uint8_t *)(item) < (uint8_t *)(head) + (head)->size; | part = KDBUS_ITEM_NEXT(part)) | |||
\ | ||||
item = KDBUS_ITEM_NEXT(item)) | ||||
#define KDBUS_ITEM_HEADER_SIZE offsetof(struct kdbus_item, data) | #define KDBUS_ITEM_HEADER_SIZE offsetof(struct kdbus_item, data) | |||
#define KDBUS_ITEM_SIZE(s) ALIGN8((s) + KDBUS_ITEM_HEADER_SIZE) | #define KDBUS_ITEM_SIZE(s) ALIGN8((s) + KDBUS_ITEM_HEADER_SIZE) | |||
#define MEMFD_CACHE_MAX 32 | #define MEMFD_CACHE_MAX 32 | |||
/* When we cache a memfd block for reuse, we will truncate blocks | /* When we cache a memfd block for reuse, we will truncate blocks | |||
* longer than this in order not to keep too much data around. */ | * longer than this in order not to keep too much data around. */ | |||
#define MEMFD_CACHE_ITEM_SIZE_MAX (128*1024) | #define MEMFD_CACHE_ITEM_SIZE_MAX (128*1024) | |||
/* This determines at which minimum size we prefer sending memfds over | /* This determines at which minimum size we prefer sending memfds over | |||
* sending vectors */ | * sending vectors */ | |||
#define MEMFD_MIN_SIZE (128*1024) | #define MEMFD_MIN_SIZE (512*1024) | |||
/* The size of the per-connection memory pool that we set up and where | /* The size of the per-connection memory pool that we set up and where | |||
* the kernel places our incoming messages */ | * the kernel places our incoming messages */ | |||
#define KDBUS_POOL_SIZE (16*1024*1024) | #define KDBUS_POOL_SIZE (16*1024*1024) | |||
struct memfd_cache { | struct memfd_cache { | |||
int fd; | int fd; | |||
void *address; | void *address; | |||
size_t size; | size_t mapped; | |||
size_t allocated; | ||||
}; | }; | |||
int bus_kernel_connect(sd_bus *b); | int bus_kernel_connect(sd_bus *b); | |||
int bus_kernel_take_fd(sd_bus *b); | int bus_kernel_take_fd(sd_bus *b); | |||
int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m); | int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync | |||
int bus_kernel_read_message(sd_bus *bus, sd_bus_message **m); | _call); | |||
int bus_kernel_read_message(sd_bus *bus, bool hint_priority, int64_t priori | ||||
ty); | ||||
int bus_kernel_open_bus_fd(const char *bus); | ||||
int bus_kernel_make_starter(int fd, const char *name, bool activating, bool | ||||
accept_fd, BusNamePolicy *policy, BusNamePolicyAccess world_policy); | ||||
int bus_kernel_create(const char *name, char **s); | int bus_kernel_create_bus(const char *name, bool world, char **s); | |||
int bus_kernel_create_domain(const char *name, char **s); | ||||
int bus_kernel_create_monitor(const char *bus); | ||||
int bus_kernel_pop_memfd(sd_bus *bus, void **address, size_t *size); | int bus_kernel_pop_memfd(sd_bus *bus, void **address, size_t *mapped, size_ | |||
void bus_kernel_push_memfd(sd_bus *bus, int fd, void *address, size_t size) | t *allocated); | |||
; | void bus_kernel_push_memfd(sd_bus *bus, int fd, void *address, size_t mappe | |||
d, size_t allocated); | ||||
void bus_kernel_flush_memfd(sd_bus *bus); | void bus_kernel_flush_memfd(sd_bus *bus); | |||
int bus_kernel_parse_unique_name(const char *s, uint64_t *id); | int bus_kernel_parse_unique_name(const char *s, uint64_t *id); | |||
int kdbus_translate_request_name_flags(uint64_t sd_bus_flags, uint64_t *kdb | ||||
us_flags); | ||||
int kdbus_translate_attach_flags(uint64_t sd_bus_flags, uint64_t *kdbus_fla | ||||
gs); | ||||
int bus_kernel_try_close(sd_bus *bus); | ||||
int bus_kernel_drop_one(int fd); | ||||
End of changes. 8 change blocks. | ||||
15 lines changed or deleted | 26 lines changed or added | |||
bus-match.h | bus-match.h | |||
---|---|---|---|---|
skipping to change at line 34 | skipping to change at line 34 | |||
#include "hashmap.h" | #include "hashmap.h" | |||
#include "sd-bus.h" | #include "sd-bus.h" | |||
enum bus_match_node_type { | enum bus_match_node_type { | |||
BUS_MATCH_ROOT, | BUS_MATCH_ROOT, | |||
BUS_MATCH_VALUE, | BUS_MATCH_VALUE, | |||
BUS_MATCH_LEAF, | BUS_MATCH_LEAF, | |||
/* The following are all different kinds of compare nodes */ | /* The following are all different kinds of compare nodes */ | |||
BUS_MATCH_MESSAGE_TYPE, | ||||
BUS_MATCH_SENDER, | BUS_MATCH_SENDER, | |||
BUS_MATCH_MESSAGE_TYPE, | ||||
BUS_MATCH_DESTINATION, | BUS_MATCH_DESTINATION, | |||
BUS_MATCH_INTERFACE, | BUS_MATCH_INTERFACE, | |||
BUS_MATCH_MEMBER, | BUS_MATCH_MEMBER, | |||
BUS_MATCH_PATH, | BUS_MATCH_PATH, | |||
BUS_MATCH_PATH_NAMESPACE, | BUS_MATCH_PATH_NAMESPACE, | |||
BUS_MATCH_ARG, | BUS_MATCH_ARG, | |||
BUS_MATCH_ARG_LAST = BUS_MATCH_ARG + 63, | BUS_MATCH_ARG_LAST = BUS_MATCH_ARG + 63, | |||
BUS_MATCH_ARG_PATH, | BUS_MATCH_ARG_PATH, | |||
BUS_MATCH_ARG_PATH_LAST = BUS_MATCH_ARG_PATH + 63, | BUS_MATCH_ARG_PATH_LAST = BUS_MATCH_ARG_PATH + 63, | |||
BUS_MATCH_ARG_NAMESPACE, | BUS_MATCH_ARG_NAMESPACE, | |||
skipping to change at line 61 | skipping to change at line 61 | |||
struct bus_match_node { | struct bus_match_node { | |||
enum bus_match_node_type type; | enum bus_match_node_type type; | |||
struct bus_match_node *parent, *next, *prev, *child; | struct bus_match_node *parent, *next, *prev, *child; | |||
union { | union { | |||
struct { | struct { | |||
char *str; | char *str; | |||
uint8_t u8; | uint8_t u8; | |||
} value; | } value; | |||
struct { | struct { | |||
sd_bus_message_handler_t callback; | struct match_callback *callback; | |||
void *userdata; | ||||
unsigned last_iteration; | ||||
uint64_t cookie; | ||||
} leaf; | } leaf; | |||
struct { | struct { | |||
/* If this is set, then the child is NULL */ | /* If this is set, then the child is NULL */ | |||
Hashmap *children; | Hashmap *children; | |||
} compare; | } compare; | |||
}; | }; | |||
}; | }; | |||
struct bus_match_component { | struct bus_match_component { | |||
enum bus_match_node_type type; | enum bus_match_node_type type; | |||
uint8_t value_u8; | uint8_t value_u8; | |||
char *value_str; | char *value_str; | |||
}; | }; | |||
int bus_match_run(sd_bus *bus, struct bus_match_node *root, sd_bus_message *m); | int bus_match_run(sd_bus *bus, struct bus_match_node *root, sd_bus_message *m); | |||
int bus_match_add(struct bus_match_node *root, struct bus_match_component * | int bus_match_add(struct bus_match_node *root, struct bus_match_component * | |||
components, unsigned n_components, sd_bus_message_handler_t callback, void | components, unsigned n_components, struct match_callback *callback); | |||
*userdata, uint64_t cookie, struct bus_match_node **ret); | int bus_match_remove(struct bus_match_node *root, struct match_callback *ca | |||
int bus_match_remove(struct bus_match_node *root, struct bus_match_componen | llback); | |||
t *components, unsigned n_components, sd_bus_message_handler_t callback, vo | ||||
id *userdata, uint64_t *cookie); | int bus_match_find(struct bus_match_node *root, struct bus_match_component | |||
*components, unsigned n_components, sd_bus_message_handler_t callback, void | ||||
*userdata, struct match_callback **ret); | ||||
void bus_match_free(struct bus_match_node *node); | void bus_match_free(struct bus_match_node *node); | |||
void bus_match_dump(struct bus_match_node *node, unsigned level); | void bus_match_dump(struct bus_match_node *node, unsigned level); | |||
const char* bus_match_node_type_to_string(enum bus_match_node_type t, char buf[], size_t l); | const char* bus_match_node_type_to_string(enum bus_match_node_type t, char buf[], size_t l); | |||
enum bus_match_node_type bus_match_node_type_from_string(const char *k, siz e_t n); | enum bus_match_node_type bus_match_node_type_from_string(const char *k, siz e_t n); | |||
int bus_match_parse(const char *match, struct bus_match_component **_compon ents, unsigned *_n_components); | int bus_match_parse(const char *match, struct bus_match_component **_compon ents, unsigned *_n_components); | |||
void bus_match_parse_free(struct bus_match_component *components, unsigned n_components); | void bus_match_parse_free(struct bus_match_component *components, unsigned n_components); | |||
char *bus_match_to_string(struct bus_match_component *components, unsigned n_components); | ||||
End of changes. 5 change blocks. | ||||
11 lines changed or deleted | 10 lines changed or added | |||
bus-message.h | bus-message.h | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <byteswap.h> | #include <byteswap.h> | |||
#include <sys/socket.h> | #include <sys/socket.h> | |||
#include "macro.h" | #include "macro.h" | |||
#include "sd-bus.h" | #include "sd-bus.h" | |||
#include "kdbus.h" | #include "kdbus.h" | |||
#include "time-util.h" | #include "time-util.h" | |||
#include "bus-creds.h" | ||||
#include "bus-protocol.h" | ||||
struct bus_container { | struct bus_container { | |||
char enclosing; | char enclosing; | |||
bool need_offsets:1; | ||||
/* Indexes into the signature string */ | ||||
unsigned index, saved_index; | unsigned index, saved_index; | |||
char *signature; | char *signature; | |||
size_t before, begin, end; | ||||
/* dbus1: pointer to the array size value, if this is a value */ | ||||
uint32_t *array_size; | uint32_t *array_size; | |||
size_t before, begin; | ||||
/* gvariant: list of offsets to end of children if this is struct/d | ||||
ict entry/array */ | ||||
size_t *offsets, n_offsets, offsets_allocated, offset_index; | ||||
size_t item_size; | ||||
char *peeked_signature; | ||||
}; | }; | |||
struct bus_header { | struct bus_header { | |||
uint8_t endian; | uint8_t endian; | |||
uint8_t type; | uint8_t type; | |||
uint8_t flags; | uint8_t flags; | |||
uint8_t version; | uint8_t version; | |||
uint32_t body_size; | uint32_t body_size; | |||
/* Note that what the bus spec calls "serial" we'll call | ||||
"cookie" instead, because we don't want to imply that the | ||||
cookie was in any way monotonically increasing. */ | ||||
uint32_t serial; | uint32_t serial; | |||
uint32_t fields_size; | uint32_t fields_size; | |||
} _packed_; | } _packed_; | |||
struct bus_body_part { | struct bus_body_part { | |||
struct bus_body_part *next; | struct bus_body_part *next; | |||
void *data; | void *data; | |||
size_t size; | size_t size; | |||
size_t mapped; | size_t mapped; | |||
size_t allocated; | ||||
int memfd; | int memfd; | |||
bool free_this:1; | bool free_this:1; | |||
bool munmap_this:1; | bool munmap_this:1; | |||
bool sealed:1; | bool sealed:1; | |||
bool is_zero:1; | bool is_zero:1; | |||
}; | }; | |||
struct sd_bus_message { | struct sd_bus_message { | |||
unsigned n_ref; | unsigned n_ref; | |||
sd_bus *bus; | sd_bus *bus; | |||
uint32_t reply_serial; | uint64_t reply_cookie; | |||
const char *path; | const char *path; | |||
const char *interface; | const char *interface; | |||
const char *member; | const char *member; | |||
const char *destination; | const char *destination; | |||
const char *sender; | const char *sender; | |||
sd_bus_error error; | sd_bus_error error; | |||
uid_t uid; | sd_bus_creds creds; | |||
gid_t gid; | ||||
pid_t pid; | ||||
pid_t tid; | ||||
usec_t pid_starttime; | ||||
usec_t monotonic; | usec_t monotonic; | |||
usec_t realtime; | usec_t realtime; | |||
uint64_t seqnum; | ||||
int64_t priority; | ||||
bool sealed:1; | bool sealed:1; | |||
bool dont_send:1; | bool dont_send:1; | |||
bool allow_fds:1; | bool allow_fds:1; | |||
bool uid_valid:1; | ||||
bool gid_valid:1; | ||||
bool free_header:1; | bool free_header:1; | |||
bool free_kdbus:1; | bool free_kdbus:1; | |||
bool free_fds:1; | bool free_fds:1; | |||
bool release_kdbus:1; | bool release_kdbus:1; | |||
bool poisoned:1; | bool poisoned:1; | |||
struct bus_header *header; | struct bus_header *header; | |||
struct bus_body_part body; | struct bus_body_part body; | |||
struct bus_body_part *body_end; | struct bus_body_part *body_end; | |||
unsigned n_body_parts; | unsigned n_body_parts; | |||
char *label; | ||||
size_t rindex; | size_t rindex; | |||
struct bus_body_part *cached_rindex_part; | struct bus_body_part *cached_rindex_part; | |||
size_t cached_rindex_part_begin; | size_t cached_rindex_part_begin; | |||
uint32_t n_fds; | uint32_t n_fds; | |||
int *fds; | int *fds; | |||
struct bus_container root_container, *containers; | struct bus_container root_container, *containers; | |||
unsigned n_containers; | unsigned n_containers; | |||
size_t containers_allocated; | ||||
struct iovec *iovec; | struct iovec *iovec; | |||
struct iovec iovec_fixed[2]; | struct iovec iovec_fixed[2]; | |||
unsigned n_iovec; | unsigned n_iovec; | |||
struct kdbus_msg *kdbus; | struct kdbus_msg *kdbus; | |||
char *peeked_signature; | char *peeked_signature; | |||
/* If set replies to this message must carry the signature | ||||
* specified here to successfully seal. This is initialized | ||||
* from the vtable data */ | ||||
const char *enforced_reply_signature; | ||||
usec_t timeout; | usec_t timeout; | |||
char sender_buffer[3 + DECIMAL_STR_MAX(uint64_t) + 1]; | char sender_buffer[3 + DECIMAL_STR_MAX(uint64_t) + 1]; | |||
char destination_buffer[3 + DECIMAL_STR_MAX(uint64_t) + 1]; | char destination_buffer[3 + DECIMAL_STR_MAX(uint64_t) + 1]; | |||
const char *exe; | size_t header_offsets[_BUS_MESSAGE_HEADER_MAX]; | |||
const char *comm; | unsigned n_header_offsets; | |||
const char *tid_comm; | ||||
const char *cgroup; | ||||
const char *cmdline; | ||||
size_t cmdline_length; | ||||
char **cmdline_array; | ||||
char *session; | ||||
char *unit; | ||||
char *user_unit; | ||||
struct kdbus_audit *audit; | ||||
uint8_t *capability; | ||||
size_t capability_size; | ||||
}; | }; | |||
#define BUS_MESSAGE_NEED_BSWAP(m) ((m)->header->endian != SD_BUS_NATIVE_END IAN) | #define BUS_MESSAGE_NEED_BSWAP(m) ((m)->header->endian != BUS_NATIVE_ENDIAN ) | |||
static inline uint16_t BUS_MESSAGE_BSWAP16(sd_bus_message *m, uint16_t u) { | static inline uint16_t BUS_MESSAGE_BSWAP16(sd_bus_message *m, uint16_t u) { | |||
return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_16(u) : u; | return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_16(u) : u; | |||
} | } | |||
static inline uint32_t BUS_MESSAGE_BSWAP32(sd_bus_message *m, uint32_t u) { | static inline uint32_t BUS_MESSAGE_BSWAP32(sd_bus_message *m, uint32_t u) { | |||
return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_32(u) : u; | return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_32(u) : u; | |||
} | } | |||
static inline uint64_t BUS_MESSAGE_BSWAP64(sd_bus_message *m, uint64_t u) { | static inline uint64_t BUS_MESSAGE_BSWAP64(sd_bus_message *m, uint64_t u) { | |||
return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_64(u) : u; | return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_64(u) : u; | |||
} | } | |||
static inline uint32_t BUS_MESSAGE_SERIAL(sd_bus_message *m) { | static inline uint64_t BUS_MESSAGE_COOKIE(sd_bus_message *m) { | |||
/* Note that we return the serial converted to a 64bit value here * | ||||
/ | ||||
return BUS_MESSAGE_BSWAP32(m, m->header->serial); | return BUS_MESSAGE_BSWAP32(m, m->header->serial); | |||
} | } | |||
static inline uint32_t BUS_MESSAGE_BODY_SIZE(sd_bus_message *m) { | static inline uint32_t BUS_MESSAGE_BODY_SIZE(sd_bus_message *m) { | |||
return BUS_MESSAGE_BSWAP32(m, m->header->body_size); | return BUS_MESSAGE_BSWAP32(m, m->header->body_size); | |||
} | } | |||
static inline uint32_t BUS_MESSAGE_FIELDS_SIZE(sd_bus_message *m) { | static inline uint32_t BUS_MESSAGE_FIELDS_SIZE(sd_bus_message *m) { | |||
return BUS_MESSAGE_BSWAP32(m, m->header->fields_size); | return BUS_MESSAGE_BSWAP32(m, m->header->fields_size); | |||
} | } | |||
skipping to change at line 192 | skipping to change at line 195 | |||
static inline uint32_t BUS_MESSAGE_BODY_BEGIN(sd_bus_message *m) { | static inline uint32_t BUS_MESSAGE_BODY_BEGIN(sd_bus_message *m) { | |||
return | return | |||
sizeof(struct bus_header) + | sizeof(struct bus_header) + | |||
ALIGN8(BUS_MESSAGE_FIELDS_SIZE(m)); | ALIGN8(BUS_MESSAGE_FIELDS_SIZE(m)); | |||
} | } | |||
static inline void* BUS_MESSAGE_FIELDS(sd_bus_message *m) { | static inline void* BUS_MESSAGE_FIELDS(sd_bus_message *m) { | |||
return (uint8_t*) m->header + sizeof(struct bus_header); | return (uint8_t*) m->header + sizeof(struct bus_header); | |||
} | } | |||
static inline void bus_message_unrefp(sd_bus_message **m) { | static inline bool BUS_MESSAGE_IS_GVARIANT(sd_bus_message *m) { | |||
sd_bus_message_unref(*m); | return m->header->version == 2; | |||
} | } | |||
#define _cleanup_bus_message_unref_ __attribute__((cleanup(bus_message_unre | int bus_message_seal(sd_bus_message *m, uint64_t serial, usec_t timeout); | |||
fp))) | ||||
int bus_message_seal(sd_bus_message *m, uint64_t serial); | ||||
int bus_message_dump(sd_bus_message *m); | ||||
int bus_message_get_blob(sd_bus_message *m, void **buffer, size_t *sz); | int bus_message_get_blob(sd_bus_message *m, void **buffer, size_t *sz); | |||
int bus_message_read_strv_extend(sd_bus_message *m, char ***l); | int bus_message_read_strv_extend(sd_bus_message *m, char ***l); | |||
int bus_message_from_header( | int bus_message_from_header( | |||
sd_bus *bus, | ||||
void *header, | void *header, | |||
size_t length, | size_t length, | |||
int *fds, | int *fds, | |||
unsigned n_fds, | unsigned n_fds, | |||
const struct ucred *ucred, | const struct ucred *ucred, | |||
const char *label, | const char *label, | |||
size_t extra, | size_t extra, | |||
sd_bus_message **ret); | sd_bus_message **ret); | |||
int bus_message_from_malloc( | int bus_message_from_malloc( | |||
sd_bus *bus, | ||||
void *buffer, | void *buffer, | |||
size_t length, | size_t length, | |||
int *fds, | int *fds, | |||
unsigned n_fds, | unsigned n_fds, | |||
const struct ucred *ucred, | const struct ucred *ucred, | |||
const char *label, | const char *label, | |||
sd_bus_message **ret); | sd_bus_message **ret); | |||
const char* bus_message_get_arg(sd_bus_message *m, unsigned i); | const char* bus_message_get_arg(sd_bus_message *m, unsigned i); | |||
skipping to change at line 242 | skipping to change at line 244 | |||
#define MESSAGE_FOREACH_PART(part, i, m) \ | #define MESSAGE_FOREACH_PART(part, i, m) \ | |||
for ((i) = 0, (part) = &(m)->body; (i) < (m)->n_body_parts; (i)++, (part) = (part)->next) | for ((i) = 0, (part) = &(m)->body; (i) < (m)->n_body_parts; (i)++, (part) = (part)->next) | |||
int bus_body_part_map(struct bus_body_part *part); | int bus_body_part_map(struct bus_body_part *part); | |||
void bus_body_part_unmap(struct bus_body_part *part); | void bus_body_part_unmap(struct bus_body_part *part); | |||
int bus_message_to_errno(sd_bus_message *m); | int bus_message_to_errno(sd_bus_message *m); | |||
int bus_message_new_synthetic_error(sd_bus *bus, uint64_t serial, const sd_ bus_error *e, sd_bus_message **m); | int bus_message_new_synthetic_error(sd_bus *bus, uint64_t serial, const sd_ bus_error *e, sd_bus_message **m); | |||
int bus_message_remarshal(sd_bus *bus, sd_bus_message **m); | ||||
int bus_message_append_sender(sd_bus_message *m, const char *sender); | ||||
End of changes. 23 change blocks. | ||||
38 lines changed or deleted | 41 lines changed or added | |||
bus-signature.h | bus-signature.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
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/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
bool signature_is_single(const char *s); | bool signature_is_single(const char *s, bool allow_dict_entry); | |||
bool signature_is_pair(const char *s); | bool signature_is_pair(const char *s); | |||
bool signature_is_valid(const char *s, bool allow_dict_entry); | bool signature_is_valid(const char *s, bool allow_dict_entry); | |||
int signature_element_length(const char *s, size_t *l); | int signature_element_length(const char *s, size_t *l); | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
bus-socket.h | bus-socket.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
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/>. | |||
***/ | ***/ | |||
#include "sd-bus.h" | #include "sd-bus.h" | |||
void bus_socket_setup(sd_bus *b); | ||||
int bus_socket_connect(sd_bus *b); | int bus_socket_connect(sd_bus *b); | |||
int bus_socket_exec(sd_bus *b); | int bus_socket_exec(sd_bus *b); | |||
int bus_socket_take_fd(sd_bus *b); | int bus_socket_take_fd(sd_bus *b); | |||
int bus_socket_start_auth(sd_bus *b); | ||||
int bus_socket_write_message(sd_bus *bus, sd_bus_message *m, size_t *idx); | int bus_socket_write_message(sd_bus *bus, sd_bus_message *m, size_t *idx); | |||
int bus_socket_read_message(sd_bus *bus, sd_bus_message **m); | int bus_socket_read_message(sd_bus *bus); | |||
int bus_socket_process_opening(sd_bus *b); | int bus_socket_process_opening(sd_bus *b); | |||
int bus_socket_process_authenticating(sd_bus *b); | int bus_socket_process_authenticating(sd_bus *b); | |||
bool bus_socket_auth_needs_write(sd_bus *b); | bool bus_socket_auth_needs_write(sd_bus *b); | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 4 lines changed or added | |||
bus-type.h | bus-type.h | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
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 "sd-bus.h" | #include "sd-bus.h" | |||
#include "sd-bus-protocol.h" | #include "sd-bus-protocol.h" | |||
bool bus_type_is_valid(char c); | bool bus_type_is_valid(char c) _const_; | |||
bool bus_type_is_valid_in_signature(char c); | bool bus_type_is_valid_in_signature(char c) _const_; | |||
bool bus_type_is_basic(char c); | bool bus_type_is_basic(char c) _const_; | |||
bool bus_type_is_trivial(char c); | bool bus_type_is_trivial(char c) _const_; | |||
bool bus_type_is_container(char c); | bool bus_type_is_container(char c) _const_; | |||
int bus_type_get_alignment(char c); | ||||
int bus_type_get_size(char c); | int bus_type_get_alignment(char c) _const_; | |||
int bus_type_get_size(char c) _const_; | ||||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
capability.h | capability.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foocapabilityhfoo | #pragma once | |||
#define foocapabilityhfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2010 Lennart Poettering | Copyright 2010 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. | |||
skipping to change at line 27 | skipping to change at line 26 | |||
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/>. | |||
***/ | ***/ | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <sys/capability.h> | ||||
#include "util.h" | ||||
unsigned long cap_last_cap(void); | unsigned long cap_last_cap(void); | |||
int have_effective_cap(int value); | int have_effective_cap(int value); | |||
int capability_bounding_set_drop(uint64_t drop, bool right_now); | int capability_bounding_set_drop(uint64_t drop, bool right_now); | |||
int capability_bounding_set_drop_usermode(uint64_t drop); | int capability_bounding_set_drop_usermode(uint64_t drop); | |||
#endif | int drop_privileges(uid_t uid, gid_t gid, uint64_t keep_capabilites); | |||
DEFINE_TRIVIAL_CLEANUP_FUNC(cap_t, cap_free); | ||||
#define _cleanup_cap_free_ _cleanup_(cap_freep) | ||||
static inline void cap_free_charpp(char **p) { | ||||
if (*p) | ||||
cap_free(*p); | ||||
} | ||||
#define _cleanup_cap_free_charp_ _cleanup_(cap_free_charpp) | ||||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 4 lines changed or added | |||
catalog.h | catalog.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 <stdbool.h> | #include <stdbool.h> | |||
#include "sd-id128.h" | #include "sd-id128.h" | |||
#include "hashmap.h" | #include "hashmap.h" | |||
#include "strbuf.h" | #include "strbuf.h" | |||
int catalog_import_file(Hashmap *h, struct strbuf *sb, const char *path); | int catalog_import_file(Hashmap *h, struct strbuf *sb, const char *path); | |||
unsigned catalog_hash_func(const void *p); | unsigned long catalog_hash_func(const void *p, const uint8_t hash_key[HASH_ KEY_SIZE]); | |||
int catalog_compare_func(const void *a, const void *b) _pure_; | int catalog_compare_func(const void *a, const void *b) _pure_; | |||
int catalog_update(const char* database, const char* root, const char* cons t* dirs); | int catalog_update(const char* database, const char* root, const char* cons t* dirs); | |||
int catalog_get(const char* database, sd_id128_t id, char **data); | int catalog_get(const char* database, sd_id128_t id, char **data); | |||
int catalog_list(FILE *f, const char* database, bool oneline); | int catalog_list(FILE *f, const char* database, bool oneline); | |||
int catalog_list_items(FILE *f, const char* database, bool oneline, char ** items); | int catalog_list_items(FILE *f, const char* database, bool oneline, char ** items); | |||
int catalog_file_lang(const char *filename, char **lang); | ||||
extern const char * const catalog_file_dirs[]; | extern const char * const catalog_file_dirs[]; | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
cgroup-show.h | cgroup-show.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foocgroupshowhfoo | #pragma once | |||
#define foocgroupshowhfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2010 Lennart Poettering | Copyright 2010 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. | |||
skipping to change at line 35 | skipping to change at line 34 | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include "util.h" | #include "util.h" | |||
#include "logs-show.h" | #include "logs-show.h" | |||
int show_cgroup_by_path(const char *path, const char *prefix, unsigned colu mns, bool kernel_threads, OutputFlags flags); | int show_cgroup_by_path(const char *path, const char *prefix, unsigned colu mns, bool kernel_threads, OutputFlags flags); | |||
int show_cgroup(const char *controller, const char *path, const char *prefi x, unsigned columns, bool kernel_threads, OutputFlags flags); | int show_cgroup(const char *controller, const char *path, const char *prefi x, unsigned columns, bool kernel_threads, OutputFlags flags); | |||
int show_cgroup_and_extra_by_spec(const char *spec, const char *prefix, uns igned n_columns, bool kernel_threads, const pid_t extra_pids[], unsigned n_ extra_pids, OutputFlags flags); | int show_cgroup_and_extra_by_spec(const char *spec, const char *prefix, uns igned n_columns, bool kernel_threads, const pid_t extra_pids[], unsigned n_ extra_pids, OutputFlags flags); | |||
int show_cgroup_and_extra(const char *controller, const char *path, const c har *prefix, unsigned n_columns, bool kernel_threads, const pid_t extra_pid s[], unsigned n_extra_pids, OutputFlags flags); | int show_cgroup_and_extra(const char *controller, const char *path, const c har *prefix, unsigned n_columns, bool kernel_threads, const pid_t extra_pid s[], unsigned n_extra_pids, OutputFlags flags); | |||
#endif | ||||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added | |||
cgroup-util.h | cgroup-util.h | |||
---|---|---|---|---|
skipping to change at line 63 | skipping to change at line 63 | |||
*/ | */ | |||
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_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_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); | |||
int cg_migrate_recursive(const char *cfrom, const char *pfrom, const char * cto, const char *pto, bool ignore_self, bool remove); | int cg_migrate_recursive(const char *cfrom, const char *pfrom, const char * cto, const char *pto, bool ignore_self, bool remove); | |||
int cg_migrate_recursive_fallback(const char *cfrom, const char *pfrom, con st char *cto, const char *pto, bool ignore_self, bool rem); | int cg_migrate_recursive_fallback(const char *cfrom, const char *pfrom, con st char *cto, const char *pto, bool ignore_self, bool rem); | |||
int cg_split_spec(const char *spec, char **controller, char **path); | int cg_split_spec(const char *spec, char **controller, char **path); | |||
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); | int cg_rmdir(const char *controller, const char *path); | |||
skipping to change at line 97 | skipping to change at line 95 | |||
int cg_set_attribute(const char *controller, const char *path, const char * attribute, const char *value); | 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 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_uninstall_release_agent(const char *controller); | int cg_uninstall_release_agent(const char *controller); | |||
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_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_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_path_get_slice(const char *path, char **slice); | |||
int cg_pid_get_path_shifted(pid_t pid, char **root, char **cgroup); | int cg_shift_path(const char *cgroup, const char *cached_root, const char * | |||
*shifted); | ||||
int cg_pid_get_path_shifted(pid_t pid, const char *cached_root, char **cgro | ||||
up); | ||||
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_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); | ||||
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_slice_to_path(const char *unit, char **ret); | |||
typedef const char* (*cg_migrate_callback_t)(CGroupControllerMask mask, voi | ||||
d *userdata); | ||||
int cg_create_everywhere(CGroupControllerMask supported, CGroupControllerMa sk mask, const char *path); | int cg_create_everywhere(CGroupControllerMask supported, CGroupControllerMa sk mask, const char *path); | |||
int cg_attach_everywhere(CGroupControllerMask supported, const char *path, pid_t pid); | int cg_attach_everywhere(CGroupControllerMask supported, const char *path, pid_t pid); | |||
int cg_attach_many_everywhere(CGroupControllerMask supported, const char *p ath, Set* pids); | int cg_attach_many_everywhere(CGroupControllerMask supported, const char *p ath, Set* pids); | |||
int cg_migrate_everywhere(CGroupControllerMask supported, const char *from, const char *to); | int cg_migrate_everywhere(CGroupControllerMask supported, const char *from, const char *to, cg_migrate_callback_t callback, void *userdata); | |||
int cg_trim_everywhere(CGroupControllerMask supported, const char *path, bo ol delete_root); | int cg_trim_everywhere(CGroupControllerMask supported, const char *path, bo ol delete_root); | |||
CGroupControllerMask cg_mask_supported(void); | CGroupControllerMask cg_mask_supported(void); | |||
End of changes. 7 change blocks. | ||||
9 lines changed or deleted | 8 lines changed or added | |||
cgroup.h | cgroup.h | |||
---|---|---|---|---|
skipping to change at line 74 | skipping to change at line 74 | |||
uint64_t bandwidth; | uint64_t bandwidth; | |||
bool read; | bool read; | |||
}; | }; | |||
struct CGroupContext { | struct CGroupContext { | |||
bool cpu_accounting; | bool cpu_accounting; | |||
bool blockio_accounting; | bool blockio_accounting; | |||
bool memory_accounting; | bool memory_accounting; | |||
unsigned long cpu_shares; | unsigned long cpu_shares; | |||
unsigned long startup_cpu_shares; | ||||
usec_t cpu_quota_per_sec_usec; | ||||
unsigned long blockio_weight; | unsigned long blockio_weight; | |||
unsigned long startup_blockio_weight; | ||||
LIST_HEAD(CGroupBlockIODeviceWeight, blockio_device_weights); | LIST_HEAD(CGroupBlockIODeviceWeight, blockio_device_weights); | |||
LIST_HEAD(CGroupBlockIODeviceBandwidth, blockio_device_bandwidths); | LIST_HEAD(CGroupBlockIODeviceBandwidth, blockio_device_bandwidths); | |||
uint64_t memory_limit; | uint64_t memory_limit; | |||
CGroupDevicePolicy device_policy; | CGroupDevicePolicy device_policy; | |||
LIST_HEAD(CGroupDeviceAllow, device_allow); | LIST_HEAD(CGroupDeviceAllow, device_allow); | |||
}; | }; | |||
#include "unit.h" | #include "unit.h" | |||
#include "manager.h" | #include "manager.h" | |||
#include "cgroup-util.h" | #include "cgroup-util.h" | |||
void cgroup_context_init(CGroupContext *c); | void cgroup_context_init(CGroupContext *c); | |||
void cgroup_context_done(CGroupContext *c); | void cgroup_context_done(CGroupContext *c); | |||
void cgroup_context_dump(CGroupContext *c, FILE* f, const char *prefix); | void cgroup_context_dump(CGroupContext *c, FILE* f, const char *prefix); | |||
void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, cons | void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, cons | |||
t char *path); | t char *path, ManagerState state); | |||
CGroupControllerMask cgroup_context_get_mask(CGroupContext *c); | CGroupControllerMask cgroup_context_get_mask(CGroupContext *c); | |||
void cgroup_context_free_device_allow(CGroupContext *c, CGroupDeviceAllow * a); | 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_weight(CGroupContext *c, CGroupBloc kIODeviceWeight *w); | |||
void cgroup_context_free_blockio_device_bandwidth(CGroupContext *c, CGroupB lockIODeviceBandwidth *b); | void cgroup_context_free_blockio_device_bandwidth(CGroupContext *c, CGroupB lockIODeviceBandwidth *b); | |||
CGroupControllerMask unit_get_cgroup_mask(Unit *u); | ||||
CGroupControllerMask unit_get_siblings_mask(Unit *u); | ||||
CGroupControllerMask unit_get_members_mask(Unit *u); | ||||
CGroupControllerMask unit_get_target_mask(Unit *u); | ||||
void unit_update_cgroup_members_masks(Unit *u); | ||||
int unit_realize_cgroup(Unit *u); | int unit_realize_cgroup(Unit *u); | |||
void unit_destroy_cgroup(Unit *u); | void unit_destroy_cgroup(Unit *u); | |||
int manager_setup_cgroup(Manager *m); | int manager_setup_cgroup(Manager *m); | |||
void manager_shutdown_cgroup(Manager *m, bool delete); | void manager_shutdown_cgroup(Manager *m, bool delete); | |||
unsigned manager_dispatch_cgroup_queue(Manager *m); | unsigned manager_dispatch_cgroup_queue(Manager *m); | |||
Unit *manager_get_unit_by_cgroup(Manager *m, const char *cgroup); | Unit *manager_get_unit_by_cgroup(Manager *m, const char *cgroup); | |||
Unit* manager_get_unit_by_pid(Manager *m, pid_t pid); | Unit* manager_get_unit_by_pid(Manager *m, pid_t pid); | |||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 12 lines changed or added | |||
compress.h | compress.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
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/>. | |||
***/ | ***/ | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <unistd.h> | ||||
bool compress_blob(const void *src, uint64_t src_size, void *dst, uint64_t *dst_size); | bool compress_blob(const void *src, uint64_t src_size, void *dst, uint64_t *dst_size); | |||
bool uncompress_blob(const void *src, uint64_t src_size, | bool uncompress_blob(const void *src, uint64_t src_size, | |||
void **dst, uint64_t *dst_alloc_size, uint64_t* dst_si ze, uint64_t dst_max); | void **dst, uint64_t *dst_alloc_size, uint64_t* dst_si ze, uint64_t dst_max); | |||
bool uncompress_startswith(const void *src, uint64_t src_size, | bool uncompress_startswith(const void *src, uint64_t src_size, | |||
void **buffer, uint64_t *buffer_size, | void **buffer, uint64_t *buffer_size, | |||
const void *prefix, uint64_t prefix_len, | const void *prefix, uint64_t prefix_len, | |||
uint8_t extra); | uint8_t extra); | |||
int compress_stream(int fdf, int fdt, uint32_t preset, off_t max_size); | ||||
int decompress_stream(int fdf, int fdt, off_t max_size); | ||||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
condition.h | condition.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | #include "condition-util.h" | |||
#include "list.h" | ||||
typedef enum ConditionType { | ||||
CONDITION_PATH_EXISTS, | ||||
CONDITION_PATH_EXISTS_GLOB, | ||||
CONDITION_PATH_IS_DIRECTORY, | ||||
CONDITION_PATH_IS_SYMBOLIC_LINK, | ||||
CONDITION_PATH_IS_MOUNT_POINT, | ||||
CONDITION_PATH_IS_READ_WRITE, | ||||
CONDITION_DIRECTORY_NOT_EMPTY, | ||||
CONDITION_FILE_NOT_EMPTY, | ||||
CONDITION_FILE_IS_EXECUTABLE, | ||||
CONDITION_KERNEL_COMMAND_LINE, | ||||
CONDITION_VIRTUALIZATION, | ||||
CONDITION_SECURITY, | ||||
CONDITION_CAPABILITY, | ||||
CONDITION_HOST, | ||||
CONDITION_AC_POWER, | ||||
CONDITION_NULL, | ||||
_CONDITION_TYPE_MAX, | ||||
_CONDITION_TYPE_INVALID = -1 | ||||
} ConditionType; | ||||
typedef struct Condition { | ||||
ConditionType type; | ||||
bool trigger:1; | ||||
bool negate:1; | ||||
char *parameter; | ||||
int state; | ||||
LIST_FIELDS(struct Condition, conditions); | ||||
} Condition; | ||||
Condition* condition_new(ConditionType type, const char *parameter, bool tr | ||||
igger, bool negate); | ||||
void condition_free(Condition *c); | ||||
void condition_free_list(Condition *c); | ||||
bool condition_test_list(const char *unit, Condition *c); | bool condition_test_list(const char *unit, Condition *c); | |||
void condition_dump(Condition *c, FILE *f, const char *prefix); | ||||
void condition_dump_list(Condition *c, FILE *f, const char *prefix); | ||||
const char* condition_type_to_string(ConditionType t) _const_; | ||||
int condition_type_from_string(const char *s) _pure_; | ||||
End of changes. 2 change blocks. | ||||
42 lines changed or deleted | 1 lines changed or added | |||
conf-files.h | conf-files.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooconffileshfoo | #pragma once | |||
#define fooconffileshfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2010-2012 Lennart Poettering | Copyright 2010-2012 Lennart Poettering | |||
Copyright 2010-2012 Kay Sievers | Copyright 2010-2012 Kay Sievers | |||
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 | |||
skipping to change at line 31 | 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 "macro.h" | #include "macro.h" | |||
int conf_files_list(char ***strv, const char *suffix, const char *root, con st char *dir, ...); | int conf_files_list(char ***strv, const char *suffix, const char *root, con st char *dir, ...); | |||
int conf_files_list_strv(char ***strv, const char *suffix, const char *root , const char* const* dirs); | int conf_files_list_strv(char ***strv, const char *suffix, const char *root , const char* const* dirs); | |||
int conf_files_list_nulstr(char ***strv, const char *suffix, const char *ro ot, const char *dirs); | int conf_files_list_nulstr(char ***strv, const char *suffix, const char *ro ot, const char *dirs); | |||
#endif | ||||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added | |||
conf-parser.h | conf-parser.h | |||
---|---|---|---|---|
skipping to change at line 37 | skipping to change at line 37 | |||
#include "macro.h" | #include "macro.h" | |||
/* An abstract parser for simple, line based, shallow configuration | /* An abstract parser for simple, line based, shallow configuration | |||
* files consisting of variable assignments only. */ | * files consisting of variable assignments only. */ | |||
/* Prototype for a parser for a specific configuration setting */ | /* Prototype for a parser for a specific configuration setting */ | |||
typedef int (*ConfigParserCallback)(const char *unit, | typedef int (*ConfigParserCallback)(const char *unit, | |||
const char *filename, | const char *filename, | |||
unsigned line, | unsigned line, | |||
const char *section, | const char *section, | |||
unsigned section_line, | ||||
const char *lvalue, | const char *lvalue, | |||
int ltype, | int ltype, | |||
const char *rvalue, | const char *rvalue, | |||
void *data, | void *data, | |||
void *userdata); | void *userdata); | |||
/* Wraps information for parsing a specific configuration variable, to | /* Wraps information for parsing a specific configuration variable, to | |||
* be stored in a simple array */ | * be stored in a simple array */ | |||
typedef struct ConfigTableItem { | typedef struct ConfigTableItem { | |||
const char *section; /* Section */ | const char *section; /* Section */ | |||
const char *lvalue; /* Name of the variable */ | const char *lvalue; /* Name of the variable */ | |||
ConfigParserCallback parse; /* Function that is called to parse the variable's value */ | ConfigParserCallback parse; /* Function that is called to parse the variable's value */ | |||
int ltype; /* Distinguish different variables passed to the same callback */ | int ltype; /* Distinguish different variables passed to the same callback */ | |||
void *data; /* Where to store the variable's da ta */ | void *data; /* Where to store the variable's da ta */ | |||
} ConfigTableItem; | } ConfigTableItem; | |||
/* Wraps information for parsing a specific configuration variable, to | /* Wraps information for parsing a specific configuration variable, to | |||
* ve srored in a gperf perfect hashtable */ | * be stored in a gperf perfect hashtable */ | |||
typedef struct ConfigPerfItem { | typedef struct ConfigPerfItem { | |||
const char *section_and_lvalue; /* Section + "." + name of the vari able */ | const char *section_and_lvalue; /* Section + "." + name of the vari able */ | |||
ConfigParserCallback parse; /* Function that is called to parse the variable's value */ | ConfigParserCallback parse; /* Function that is called to parse the variable's value */ | |||
int ltype; /* Distinguish different variables passed to the same callback */ | int ltype; /* Distinguish different variables passed to the same callback */ | |||
size_t offset; /* Offset where to store data, from the beginning of userdata */ | size_t offset; /* Offset where to store data, from the beginning of userdata */ | |||
} ConfigPerfItem; | } ConfigPerfItem; | |||
/* Prototype for a low-level gperf lookup function */ | /* Prototype for a low-level gperf lookup function */ | |||
typedef const ConfigPerfItem* (*ConfigPerfItemLookup)(const char *section_a nd_lvalue, unsigned length); | typedef const ConfigPerfItem* (*ConfigPerfItemLookup)(const char *section_a nd_lvalue, unsigned length); | |||
skipping to change at line 94 | skipping to change at line 95 | |||
const char *filename, | const char *filename, | |||
FILE *f, | FILE *f, | |||
const char *sections, /* nulstr */ | const char *sections, /* nulstr */ | |||
ConfigItemLookup lookup, | ConfigItemLookup lookup, | |||
void *table, | void *table, | |||
bool relaxed, | bool relaxed, | |||
bool allow_include, | bool allow_include, | |||
void *userdata); | void *userdata); | |||
/* Generic parsers */ | /* Generic parsers */ | |||
int config_parse_int(const char *unit, const char *filename, unsigned line, | int config_parse_int(const char *unit, const char *filename, unsigned line, | |||
const char *section, const char *lvalue, int ltype, const char *rvalue, vo | const char *section, unsigned section_line, const char *lvalue, int ltype, | |||
id *data, void *userdata); | const char *rvalue, void *data, void *userdata); | |||
int config_parse_unsigned(const char *unit, const char *filename, unsigned | int config_parse_unsigned(const char *unit, const char *filename, unsigned | |||
line, const char *section, const char *lvalue, int ltype, const char *rvalu | line, const char *section, unsigned section_line, const char *lvalue, int l | |||
e, void *data, void *userdata); | type, const char *rvalue, void *data, void *userdata); | |||
int config_parse_long(const char *unit, const char *filename, unsigned line | int config_parse_long(const char *unit, const char *filename, unsigned line | |||
, const char *section, const char *lvalue, int ltype, const char *rvalue, v | , const char *section, unsigned section_line, const char *lvalue, int ltype | |||
oid *data, void *userdata); | , const char *rvalue, void *data, void *userdata); | |||
int config_parse_uint64(const char *unit, const char *filename, unsigned li | int config_parse_uint64(const char *unit, const char *filename, unsigned li | |||
ne, const char *section, const char *lvalue, int ltype, const char *rvalue, | ne, const char *section, unsigned section_line, const char *lvalue, int lty | |||
void *data, void *userdata); | pe, const char *rvalue, void *data, void *userdata); | |||
int config_parse_double(const char *unit, const char *filename, unsigned li | int config_parse_double(const char *unit, const char *filename, unsigned li | |||
ne, const char *section, const char *lvalue, int ltype, const char *rvalue, | ne, const char *section, unsigned section_line, const char *lvalue, int lt | |||
void *data, void *userdata); | ype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_bytes_size(const char *unit, const char *filename, unsigne | int config_parse_iec_size(const char *unit, const char *filename, unsigned | |||
d line, const char *section, const char *lvalue, int ltype, const char *rva | line, const char *section, unsigned section_line, const char *lvalue, int l | |||
lue, void *data, void *userdata); | type, const char *rvalue, void *data, void *userdata); | |||
int config_parse_bytes_off(const char *unit, const char *filename, unsigned | int config_parse_si_size(const char *unit, const char *filename, unsigned l | |||
line, const char *section, const char *lvalue, int ltype, const char *rval | ine, const char *section, unsigned section_line, const char *lvalue, int lt | |||
ue, void *data, void *userdata); | ype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_bool(const char *unit, const char *filename, unsigned line | int config_parse_iec_off(const char *unit, const char *filename, unsigned l | |||
, const char *section, const char *lvalue, int ltype, const char *rvalue, v | ine, const char *section, unsigned section_line, const char *lvalue, int lt | |||
oid *data, void *userdata); | ype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_tristate(const char *unit, const char *filename, unsigned | int config_parse_bool(const char *unit, const char *filename, unsigned line | |||
line, const char *section, const char *lvalue, int ltype, const char *rvalu | , const char *section, unsigned section_line, const char *lvalue, int ltype | |||
e, void *data, void *userdata); | , const char *rvalue, void *data, void *userdata); | |||
int config_parse_string(const char *unit, const char *filename, unsigned li | int config_parse_string(const char *unit, const char *filename, unsigned li | |||
ne, const char *section, const char *lvalue, int ltype, const char *rvalue, | ne, const char *section, unsigned section_line, const char *lvalue, int lty | |||
void *data, void *userdata); | pe, const char *rvalue, void *data, void *userdata); | |||
int config_parse_path(const char *unit, const char *filename, unsigned line | int config_parse_path(const char *unit, const char *filename, unsigned line | |||
, const char *section, const char *lvalue, int ltype, const char *rvalue, v | , const char *section, unsigned section_line, const char *lvalue, int ltype | |||
oid *data, void *userdata); | , const char *rvalue, void *data, void *userdata); | |||
int config_parse_strv(const char *unit, const char *filename, unsigned line | int config_parse_strv(const char *unit, const char *filename, unsigned line | |||
, const char *section, const char *lvalue, int ltype, const char *rvalue, v | , const char *section, unsigned section_line, const char *lvalue, int ltype | |||
oid *data, void *userdata); | , const char *rvalue, void *data, void *userdata); | |||
int config_parse_path_strv(const char *unit, const char *filename, unsigned | int config_parse_sec(const char *unit, const char *filename, unsigned line, | |||
line, const char *section, const char *lvalue, int ltype, const char *rval | const char *section, unsigned section_line, const char *lvalue, int ltype, | |||
ue, void *data, void *userdata); | const char *rvalue, void *data, void *userdata); | |||
int config_parse_sec(const char *unit, const char *filename, unsigned line, | int config_parse_nsec(const char *unit, const char *filename, unsigned line | |||
const char *section, const char *lvalue, int ltype, const char *rvalue, vo | , const char *section, unsigned section_line, const char *lvalue, int ltype | |||
id *data, void *userdata); | , const char *rvalue, void *data, void *userdata); | |||
int config_parse_nsec(const char *unit, const char *filename, unsigned line | int config_parse_mode(const char *unit, const char *filename, unsigned line | |||
, const char *section, const char *lvalue, int ltype, const char *rvalue, v | , const char *section, unsigned section_line, const char *lvalue, int ltype | |||
oid *data, void *userdata); | , const char *rvalue, void *data, void *userdata); | |||
int config_parse_mode(const char *unit, const char *filename, unsigned line | int config_parse_log_facility(const char *unit, const char *filename, unsig | |||
, const char *section, const char *lvalue, int ltype, const char *rvalue, v | ned line, const char *section, unsigned section_line, const char *lvalue, i | |||
oid *data, void *userdata); | nt ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_facility(const char *unit, const char *filename, unsigned | int config_parse_log_level(const char *unit, const char *filename, unsigned | |||
line, const char *section, const char *lvalue, int ltype, const char *rvalu | line, const char *section, unsigned section_line, const char *lvalue, int | |||
e, void *data, void *userdata); | ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_level(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_set_status(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 log_syntax_internal(const char *unit, int level, | int log_syntax_internal(const char *unit, int level, | |||
const char *file, unsigned line, const char *func, | const char *file, unsigned line, const char *func, | |||
const char *config_file, unsigned config_line, | const char *config_file, unsigned config_line, | |||
int error, const char *format, ...) _printf_attr_(9 , 10); | int error, const char *format, ...) _printf_(9, 10) ; | |||
#define log_syntax(unit, level, config_file, config_line, error, ...) \ | #define log_syntax(unit, level, config_file, config_line, error, ...) \ | |||
log_syntax_internal(unit, level, \ | log_syntax_internal(unit, level, \ | |||
__FILE__, __LINE__, __func__, \ | __FILE__, __LINE__, __func__, \ | |||
config_file, config_line, \ | config_file, config_line, \ | |||
error, __VA_ARGS__) | error, __VA_ARGS__) | |||
#define log_invalid_utf8(unit, level, config_file, config_line, error, rval | ||||
ue) { \ | ||||
_cleanup_free_ char *__p = utf8_escape_invalid(rvalue); | ||||
\ | ||||
log_syntax(unit, level, config_file, config_line, error, | ||||
\ | ||||
"String is not UTF-8 clean, ignoring assignment: %s", __ | ||||
p); \ | ||||
} | ||||
#define DEFINE_CONFIG_PARSE_ENUM(function,name,type,msg) \ | #define DEFINE_CONFIG_PARSE_ENUM(function,name,type,msg) \ | |||
int function(const char *unit, \ | int function(const char *unit, \ | |||
const char *filename, \ | const char *filename, \ | |||
unsigned line, \ | unsigned line, \ | |||
const char *section, \ | const char *section, \ | |||
unsigned section_line, \ | ||||
const char *lvalue, \ | const char *lvalue, \ | |||
int ltype, \ | int ltype, \ | |||
const char *rvalue, \ | const char *rvalue, \ | |||
void *data, \ | void *data, \ | |||
void *userdata) { \ | void *userdata) { \ | |||
\ | \ | |||
type *i = data, x; \ | type *i = data, x; \ | |||
\ | \ | |||
assert(filename); \ | assert(filename); \ | |||
assert(lvalue); \ | assert(lvalue); \ | |||
skipping to change at line 152 | skipping to change at line 158 | |||
\ | \ | |||
if ((x = name##_from_string(rvalue)) < 0) { \ | if ((x = name##_from_string(rvalue)) < 0) { \ | |||
log_syntax(unit, LOG_ERR, filename, line, -x, \ | log_syntax(unit, LOG_ERR, filename, line, -x, \ | |||
msg ", ignoring: %s", rvalue); \ | msg ", ignoring: %s", rvalue); \ | |||
return 0; \ | return 0; \ | |||
} \ | } \ | |||
\ | \ | |||
*i = x; \ | *i = x; \ | |||
return 0; \ | return 0; \ | |||
} | } | |||
#define DEFINE_CONFIG_PARSE_ENUMV(function,name,type,invalid,msg) | ||||
\ | ||||
int function(const char *unit, | ||||
\ | ||||
const char *filename, | ||||
\ | ||||
unsigned line, | ||||
\ | ||||
const char *section, | ||||
\ | ||||
unsigned section_line, | ||||
\ | ||||
const char *lvalue, | ||||
\ | ||||
int ltype, | ||||
\ | ||||
const char *rvalue, | ||||
\ | ||||
void *data, | ||||
\ | ||||
void *userdata) { | ||||
\ | ||||
\ | ||||
type **enums = data, *xs, x, *ys; | ||||
\ | ||||
char *w, *state; | ||||
\ | ||||
size_t l, i = 0; | ||||
\ | ||||
\ | ||||
assert(filename); | ||||
\ | ||||
assert(lvalue); | ||||
\ | ||||
assert(rvalue); | ||||
\ | ||||
assert(data); | ||||
\ | ||||
\ | ||||
xs = new0(type, 1); | ||||
\ | ||||
*xs = invalid; | ||||
\ | ||||
\ | ||||
FOREACH_WORD(w, l, rvalue, state) { | ||||
\ | ||||
_cleanup_free_ char *en = NULL; | ||||
\ | ||||
\ | ||||
en = strndup(w, l); | ||||
\ | ||||
if (!en) | ||||
\ | ||||
return -ENOMEM; | ||||
\ | ||||
\ | ||||
if ((x = name##_from_string(en)) < 0) { | ||||
\ | ||||
log_syntax(unit, LOG_ERR, filename, line, | ||||
\ | ||||
-x, msg ", ignoring: %s", en); | ||||
\ | ||||
continue; | ||||
\ | ||||
} | ||||
\ | ||||
\ | ||||
for (ys = xs; x != invalid && *ys != invalid; ys++) | ||||
{ \ | ||||
if (*ys == x) { | ||||
\ | ||||
log_syntax(unit, LOG_ERR, filename, | ||||
\ | ||||
line, -x, | ||||
\ | ||||
"Duplicate entry, ignoring: % | ||||
s", \ | ||||
en); | ||||
\ | ||||
x = invalid; | ||||
\ | ||||
} | ||||
\ | ||||
} | ||||
\ | ||||
\ | ||||
if (x == invalid) | ||||
\ | ||||
continue; | ||||
\ | ||||
\ | ||||
*(xs + i) = x; | ||||
\ | ||||
xs = realloc(xs, (++i + 1) * sizeof(type)); | ||||
\ | ||||
if (!xs) | ||||
\ | ||||
return -ENOMEM; | ||||
\ | ||||
*(xs + i) = invalid; | ||||
\ | ||||
} | ||||
\ | ||||
\ | ||||
free(*enums); | ||||
\ | ||||
*enums = xs; | ||||
\ | ||||
return 0; | ||||
\ | ||||
} | ||||
End of changes. 7 change blocks. | ||||
59 lines changed or deleted | 65 lines changed or added | |||
config.h | config.h | |||
---|---|---|---|---|
/* config.h. Generated from config.h.in by configure. */ | /* config.h. Generated from config.h.in by configure. */ | |||
/* config.h.in. Generated from configure.ac by autoheader. */ | /* config.h.in. Generated from configure.ac by autoheader. */ | |||
/* Whether on mips arch */ | /* Whether on mips arch */ | |||
/* #undef ARCH_MIPS */ | /* #undef ARCH_MIPS */ | |||
/* Canonical host string. */ | /* Canonical host string. */ | |||
#define CANONICAL_HOST "i686-pc-linux-gnu" | #define CANONICAL_HOST "i686-pc-linux-gnu" | |||
/* Default DNS Servers */ | ||||
#define DNS_SERVERS "8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8 | ||||
844" | ||||
/* Define if EFI support is to be enabled */ | /* Define if EFI support is to be enabled */ | |||
#define ENABLE_EFI 1 | #define ENABLE_EFI 1 | |||
/* Define if kdbus support is to be enabled */ | ||||
/* #undef ENABLE_KDBUS */ | ||||
/* Define if networkd support is to be enabled */ | ||||
#define ENABLE_NETWORKD 1 | ||||
/* Define if PolicyKit support is to be enabled */ | /* Define if PolicyKit support is to be enabled */ | |||
#define ENABLE_POLKIT 1 | #define ENABLE_POLKIT 1 | |||
/* ACL available */ | /* ACL available */ | |||
#define HAVE_ACL 1 | #define HAVE_ACL 1 | |||
/* Define to 1 if you have the <acl/libacl.h> header file. */ | /* Define to 1 if you have the <acl/libacl.h> header file. */ | |||
#define HAVE_ACL_LIBACL_H 1 | #define HAVE_ACL_LIBACL_H 1 | |||
/* Define if AppArmor is available */ | ||||
/* #undef HAVE_APPARMOR */ | ||||
/* Define to 1 if you have the <arpa/inet.h> header file. */ | /* Define to 1 if you have the <arpa/inet.h> header file. */ | |||
#define HAVE_ARPA_INET_H 1 | #define HAVE_ARPA_INET_H 1 | |||
/* Define to 1 if you have the <attr/xattr.h> header file. */ | ||||
#define HAVE_ATTR_XATTR_H 1 | ||||
/* AUDIT available */ | /* AUDIT available */ | |||
#define HAVE_AUDIT 1 | #define HAVE_AUDIT 1 | |||
/* Define if blkid is available */ | /* Define if blkid is available */ | |||
#define HAVE_BLKID 1 | #define HAVE_BLKID 1 | |||
/* Define if CHKCONFIG is available */ | /* Define if CHKCONFIG is available */ | |||
/* #undef HAVE_CHKCONFIG */ | /* #undef HAVE_CHKCONFIG */ | |||
/* Define if dbus-1 library is available */ | ||||
#define HAVE_DBUS 1 | ||||
/* Define to 1 if you have the declaration of `gettid', and to 0 if you don 't. | /* Define to 1 if you have the declaration of `gettid', and to 0 if you don 't. | |||
*/ | */ | |||
#define HAVE_DECL_GETTID 0 | #define HAVE_DECL_GETTID 0 | |||
/* Define to 1 if you have the declaration of `IFLA_BOND_AD_INFO', and to 0 | ||||
if | ||||
you don't. */ | ||||
#define HAVE_DECL_IFLA_BOND_AD_INFO 0 | ||||
/* Define to 1 if you have the declaration of `IFLA_BRIDGE_VLAN_INFO', and | ||||
to | ||||
0 if you don't. */ | ||||
#define HAVE_DECL_IFLA_BRIDGE_VLAN_INFO 0 | ||||
/* Define to 1 if you have the declaration of | ||||
`IFLA_IPTUN_6RD_RELAY_PREFIXLEN', and to 0 if you don't. */ | ||||
#define HAVE_DECL_IFLA_IPTUN_6RD_RELAY_PREFIXLEN 0 | ||||
/* Define to 1 if you have the declaration of `IFLA_PHYS_PORT_ID', and to 0 | ||||
if | ||||
you don't. */ | ||||
#define HAVE_DECL_IFLA_PHYS_PORT_ID 0 | ||||
/* Define to 1 if you have the declaration of `IFLA_VLAN_PROTOCOL', and to | ||||
0 | ||||
if you don't. */ | ||||
#define HAVE_DECL_IFLA_VLAN_PROTOCOL 0 | ||||
/* Define to 1 if you have the declaration of `IFLA_VXLAN_LOCAL6', and to 0 | ||||
if | ||||
you don't. */ | ||||
#define HAVE_DECL_IFLA_VXLAN_LOCAL6 0 | ||||
/* Define to 1 if you have the declaration of `LO_FLAGS_PARTSCAN', and to 0 | ||||
if | ||||
you don't. */ | ||||
#define HAVE_DECL_LO_FLAGS_PARTSCAN 1 | ||||
/* Define to 1 if you have the declaration of `name_to_handle_at', and to 0 if | /* Define to 1 if you have the declaration of `name_to_handle_at', and to 0 if | |||
you don't. */ | you don't. */ | |||
#define HAVE_DECL_NAME_TO_HANDLE_AT 0 | #define HAVE_DECL_NAME_TO_HANDLE_AT 0 | |||
/* Define to 1 if you have the declaration of `pivot_root', and to 0 if you | /* Define to 1 if you have the declaration of `pivot_root', and to 0 if you | |||
don't. */ | don't. */ | |||
#define HAVE_DECL_PIVOT_ROOT 0 | #define HAVE_DECL_PIVOT_ROOT 0 | |||
/* Define to 1 if you have the declaration of `setns', and to 0 if you don' | ||||
t. | ||||
*/ | ||||
#define HAVE_DECL_SETNS 0 | ||||
/* Define to 1 if you have the <dlfcn.h> header file. */ | /* Define to 1 if you have the <dlfcn.h> header file. */ | |||
#define HAVE_DLFCN_H 1 | #define HAVE_DLFCN_H 1 | |||
/* ELFUTILS available */ | ||||
/* #undef HAVE_ELFUTILS */ | ||||
/* Define to 1 if you have the <elfutils/libdwfl.h> header file. */ | ||||
#define HAVE_ELFUTILS_LIBDWFL_H 1 | ||||
/* Define to 1 if you have the `fanotify_init' function. */ | /* Define to 1 if you have the `fanotify_init' function. */ | |||
#define HAVE_FANOTIFY_INIT 1 | #define HAVE_FANOTIFY_INIT 1 | |||
/* Define to 1 if you have the `fanotify_mark' function. */ | /* Define to 1 if you have the `fanotify_mark' function. */ | |||
#define HAVE_FANOTIFY_MARK 1 | #define HAVE_FANOTIFY_MARK 1 | |||
/* Define to 1 if you have the <fcntl.h> header file. */ | /* Define to 1 if you have the <fcntl.h> header file. */ | |||
#define HAVE_FCNTL_H 1 | #define HAVE_FCNTL_H 1 | |||
/* Define if FIRMWARE is available */ | /* Define if FIRMWARE is available */ | |||
skipping to change at line 79 | skipping to change at line 129 | |||
/* Define to 1 if you have the `gethostbyname' function. */ | /* Define to 1 if you have the `gethostbyname' function. */ | |||
#define HAVE_GETHOSTBYNAME 1 | #define HAVE_GETHOSTBYNAME 1 | |||
/* Define to 1 if you have the `gettimeofday' function. */ | /* Define to 1 if you have the `gettimeofday' function. */ | |||
#define HAVE_GETTIMEOFDAY 1 | #define HAVE_GETTIMEOFDAY 1 | |||
/* Define if glib is available */ | /* Define if glib is available */ | |||
#define HAVE_GLIB 1 | #define HAVE_GLIB 1 | |||
/* Define if gnutls is available */ | ||||
/* #undef HAVE_GNUTLS */ | ||||
/* 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? */ | /* Define to 1 if you have the `dw' library (-ldw). */ | |||
#define HAVE_LIBWRAP /**/ | #define HAVE_LIBDW 1 | |||
/* Define to 1 if you have the <linux/btrfs.h> header file. */ | /* Define to 1 if you have the <linux/btrfs.h> header file. */ | |||
/* #undef HAVE_LINUX_BTRFS_H */ | /* #undef HAVE_LINUX_BTRFS_H */ | |||
/* Logind support available */ | /* Logind support available */ | |||
#define HAVE_LOGIND 1 | #define HAVE_LOGIND 1 | |||
/* Machined support available */ | /* Machined support available */ | |||
#define HAVE_MACHINED 1 | #define HAVE_MACHINED 1 | |||
skipping to change at line 120 | skipping to change at line 173 | |||
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 | |||
/* Define if microhttpd is available */ | /* Define if microhttpd is available */ | |||
#define HAVE_MICROHTTPD 1 | /* #undef HAVE_MICROHTTPD */ | |||
/* Define to 1 if you have the <netdb.h> header file. */ | /* Define to 1 if you have the <netdb.h> header file. */ | |||
#define HAVE_NETDB_H 1 | #define HAVE_NETDB_H 1 | |||
/* Define to 1 if you have the <netinet/in.h> header file. */ | /* Define to 1 if you have the <netinet/in.h> header file. */ | |||
#define HAVE_NETINET_IN_H 1 | #define HAVE_NETINET_IN_H 1 | |||
/* Define to 1 if you have the <nss.h> header file. */ | /* Define to 1 if you have the <nss.h> header file. */ | |||
#define HAVE_NSS_H 1 | #define HAVE_NSS_H 1 | |||
/* PAM available */ | /* PAM available */ | |||
#define HAVE_PAM 1 | #define HAVE_PAM 1 | |||
/* Define if qrencode is available */ | /* Define if qrencode is available */ | |||
#define HAVE_QRENCODE 1 | #define HAVE_QRENCODE 1 | |||
/* Define if seccomp is available */ | ||||
/* #undef HAVE_SECCOMP */ | ||||
/* Define to 1 if you have the `secure_getenv' function. */ | /* Define to 1 if you have the `secure_getenv' function. */ | |||
/* #undef HAVE_SECURE_GETENV */ | /* #undef HAVE_SECURE_GETENV */ | |||
/* Define to 1 if you have the <security/pam_ext.h> header file. */ | /* Define to 1 if you have the <security/pam_ext.h> header file. */ | |||
#define HAVE_SECURITY_PAM_EXT_H 1 | #define HAVE_SECURITY_PAM_EXT_H 1 | |||
/* Define to 1 if you have the <security/pam_modules.h> header file. */ | /* Define to 1 if you have the <security/pam_modules.h> header file. */ | |||
#define HAVE_SECURITY_PAM_MODULES_H 1 | #define HAVE_SECURITY_PAM_MODULES_H 1 | |||
/* 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. */ | |||
skipping to change at line 230 | skipping to change at line 286 | |||
/* Define to 1 if you have the <sys/types.h> header file. */ | /* Define to 1 if you have the <sys/types.h> header file. */ | |||
#define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_TYPES_H 1 | |||
/* Define to 1 if you have the <unistd.h> header file. */ | /* Define to 1 if you have the <unistd.h> header file. */ | |||
#define HAVE_UNISTD_H 1 | #define HAVE_UNISTD_H 1 | |||
/* Define to 1 if you have the <valgrind/memcheck.h> header file. */ | /* Define to 1 if you have the <valgrind/memcheck.h> header file. */ | |||
#define HAVE_VALGRIND_MEMCHECK_H 1 | #define HAVE_VALGRIND_MEMCHECK_H 1 | |||
/* XATTR available */ | /* Define to 1 if you have the <valgrind/valgrind.h> header file. */ | |||
#define HAVE_XATTR 1 | #define HAVE_VALGRIND_VALGRIND_H 1 | |||
/* Define if XZ is available */ | /* Define if XZ is available */ | |||
#define HAVE_XZ 1 | #define HAVE_XZ 1 | |||
/* Define to 1 if you have the `__secure_getenv' function. */ | /* Define to 1 if you have the `__secure_getenv' function. */ | |||
#define HAVE___SECURE_GETENV 1 | #define HAVE___SECURE_GETENV 1 | |||
/* Path of loadkeys */ | /* Path of loadkeys */ | |||
#define KBD_LOADKEYS "/usr/bin/loadkeys" | #define KBD_LOADKEYS "/usr/bin/loadkeys" | |||
/* Path of setfont */ | /* Path of setfont */ | |||
#define KBD_SETFONT "/usr/bin/setfont" | #define KBD_SETFONT "/usr/bin/setfont" | |||
/* Define to the sub-directory in which libtool stores uninstalled librarie s. | /* Define to the sub-directory in which libtool stores uninstalled librarie s. | |||
*/ | */ | |||
#define LT_OBJDIR ".libs/" | #define LT_OBJDIR ".libs/" | |||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */ | /* Default NTP Servers */ | |||
/* #undef NO_MINUS_C_MINUS_O */ | #define NTP_SERVERS "time1.google.com time2.google.com time3.google.com tim | |||
e4.google.com" | ||||
/* 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 208" | #define PACKAGE_STRING "systemd 215" | |||
/* 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 "208" | #define PACKAGE_VERSION "215" | |||
/* 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 | |||
/* Define to the type of args 2, 3 and 4 for `select'. */ | /* Define to the type of args 2, 3 and 4 for `select'. */ | |||
#define SELECT_TYPE_ARG234 (fd_set *) | #define SELECT_TYPE_ARG234 (fd_set *) | |||
/* Define to the type of arg 5 for `select'. */ | /* Define to the type of arg 5 for `select'. */ | |||
#define SELECT_TYPE_ARG5 (struct timeval *) | #define SELECT_TYPE_ARG5 (struct timeval *) | |||
/* The size of `gid_t', as computed by sizeof. */ | ||||
#define SIZEOF_GID_T 4 | ||||
/* The size of `pid_t', as computed by sizeof. */ | ||||
#define SIZEOF_PID_T 4 | ||||
/* The size of `rlim_t', as computed by sizeof. */ | ||||
#define SIZEOF_RLIM_T 8 | ||||
/* The size of `time_t', as computed by sizeof. */ | ||||
#define SIZEOF_TIME_T 4 | ||||
/* The size of `uid_t', as computed by sizeof. */ | ||||
#define SIZEOF_UID_T 4 | ||||
/* Run with a smack label */ | ||||
/* #undef SMACK_RUN_LABEL */ | ||||
/* Define to 1 if you have the ANSI C header files. */ | /* Define to 1 if you have the ANSI C header files. */ | |||
#define STDC_HEADERS 1 | #define STDC_HEADERS 1 | |||
/* Maximum System GID */ | ||||
#define SYSTEM_GID_MAX 999 | ||||
/* Maximum System UID */ | ||||
#define SYSTEM_UID_MAX 999 | ||||
/* Path to telinit */ | /* Path to telinit */ | |||
#define TELINIT "/lib/sysvinit/telinit" | #define TELINIT "/lib/sysvinit/telinit" | |||
/* Time Epoch */ | ||||
#define TIME_EPOCH 1404413182 | ||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ | /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ | |||
#define TIME_WITH_SYS_TIME 1 | #define TIME_WITH_SYS_TIME 1 | |||
/* GID of the 'tty' group */ | /* GID of the 'tty' group */ | |||
/* #undef TTY_GID */ | #define TTY_GID 5 | |||
/* Enable extensions on AIX 3, Interix. */ | /* Enable extensions on AIX 3, Interix. */ | |||
#ifndef _ALL_SOURCE | #ifndef _ALL_SOURCE | |||
# define _ALL_SOURCE 1 | # define _ALL_SOURCE 1 | |||
#endif | #endif | |||
/* Enable GNU extensions on systems that have them. */ | /* Enable GNU extensions on systems that have them. */ | |||
#ifndef _GNU_SOURCE | #ifndef _GNU_SOURCE | |||
# define _GNU_SOURCE 1 | # define _GNU_SOURCE 1 | |||
#endif | #endif | |||
/* Enable threading extensions on Solaris. */ | /* Enable threading extensions on Solaris. */ | |||
skipping to change at line 322 | skipping to change at line 405 | |||
/* 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 "208" | #define VERSION "215" | |||
/* 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. 22 change blocks. | ||||
15 lines changed or deleted | 107 lines changed or added | |||
dbus-automount.h | dbus-automount.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "unit.h" | extern const sd_bus_vtable bus_automount_vtable[]; | |||
DBusHandlerResult bus_automount_message_handler(Unit *u, DBusConnection *c, | ||||
DBusMessage *message); | ||||
extern const char bus_automount_interface[]; | ||||
extern const char bus_automount_invalidating_properties[]; | ||||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
dbus-cgroup.h | dbus-cgroup.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "manager.h" | ||||
#include "dbus-common.h" | ||||
#include "cgroup.h" | #include "cgroup.h" | |||
#define BUS_CGROUP_CONTEXT_INTERFACE \ | extern const sd_bus_vtable bus_cgroup_vtable[]; | |||
" <property name=\"CPUAccounting\" type=\"b\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"CPUShares\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"BlockIOAccounting\" type=\"b\" access=\"read\"/ | ||||
>\n" \ | ||||
" <property name=\"BlockIOWeight\" type=\"t\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"BlockIODeviceWeight\" type=\"a(st)\" access=\"r | ||||
ead\"/>\n" \ | ||||
" <property name=\"BlockIOReadBandwidth=\" type=\"a(st)\" access=\ | ||||
"read\"/>\n" \ | ||||
" <property name=\"BlockIOWriteBandwidth=\" type=\"a(st)\" access= | ||||
\"read\"/>\n" \ | ||||
" <property name=\"MemoryAccounting\" type=\"b\" access=\"read\"/> | ||||
\n" \ | ||||
" <property name=\"MemoryLimit\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"DevicePolicy\" type=\"s\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"DeviceAllow\" type=\"a(ss)\" access=\"read\"/>\ | ||||
n" | ||||
extern const BusProperty bus_cgroup_context_properties[]; | ||||
int bus_cgroup_set_property(Unit *u, CGroupContext *c, const char *name, DB usMessageIter *i, UnitSetPropertiesMode mode, DBusError *error); | int bus_cgroup_set_property(Unit *u, CGroupContext *c, const char *name, sd _bus_message *message, UnitSetPropertiesMode mode, sd_bus_error *error); | |||
End of changes. 3 change blocks. | ||||
27 lines changed or deleted | 2 lines changed or added | |||
dbus-device.h | dbus-device.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_device_message_handler(Unit *u, DBusConnection *c, DB | extern const sd_bus_vtable bus_device_vtable[]; | |||
usMessage *message); | ||||
extern const char bus_device_interface[]; | ||||
extern const char bus_device_invalidating_properties[]; | ||||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added | |||
dbus-execute.h | dbus-execute.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "execute.h" | ||||
#include "manager.h" | #define BUS_EXEC_STATUS_VTABLE(prefix, offset, flags) \ | |||
#include "dbus-common.h" | BUS_PROPERTY_DUAL_TIMESTAMP(prefix "StartTimestamp", (offset) + off | |||
setof(ExecStatus, start_timestamp), flags), \ | ||||
BUS_PROPERTY_DUAL_TIMESTAMP(prefix "ExitTimestamp", (offset) + offs | ||||
etof(ExecStatus, exit_timestamp), flags), \ | ||||
SD_BUS_PROPERTY(prefix "PID", "u", bus_property_get_pid, (offset) + | ||||
offsetof(ExecStatus, pid), flags), \ | ||||
SD_BUS_PROPERTY(prefix "Code", "i", bus_property_get_int, (offset) | ||||
+ offsetof(ExecStatus, code), flags), \ | ||||
SD_BUS_PROPERTY(prefix "Status", "i", bus_property_get_int, (offset | ||||
) + offsetof(ExecStatus, status), flags) | ||||
#define BUS_EXEC_STATUS_INTERFACE(prefix) \ | #define BUS_EXEC_COMMAND_VTABLE(name, offset, flags) \ | |||
" <property name=\"" prefix "StartTimestamp\" type=\"t\" access=\" | SD_BUS_PROPERTY(name, "a(sasbttttuii)", bus_property_get_exec_comma | |||
read\"/>\n" \ | nd, offset, flags) | |||
" <property name=\"" prefix "StartTimestampMonotonic\" type=\"t\" | ||||
access=\"read\"/>\n" \ | ||||
" <property name=\"" prefix "ExitTimestamp\" type=\"t\" access=\"r | ||||
ead\"/>\n" \ | ||||
" <property name=\"" prefix "ExitTimestampMonotonic\" type=\"t\" a | ||||
ccess=\"read\"/>\n" \ | ||||
" <property name=\"" prefix "PID\" type=\"u\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"" prefix "Code\" type=\"i\" access=\"read\"/>\n | ||||
" \ | ||||
" <property name=\"" prefix "Status\" type=\"i\" access=\"read\"/> | ||||
\n" | ||||
#define BUS_EXEC_CONTEXT_INTERFACE \ | ||||
" <property name=\"Environment\" type=\"as\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"EnvironmentFiles\" type=\"a(sb)\" access=\"read | ||||
\"/>\n" \ | ||||
" <property name=\"UMask\" type=\"u\" access=\"read\"/>\n" \ | ||||
" <property name=\"LimitCPU\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"LimitFSIZE\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"LimitDATA\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"LimitSTACK\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"LimitCORE\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"LimitRSS\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"LimitNOFILE\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"LimitAS\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"LimitNPROC\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"LimitMEMLOCK\" type=\"t\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"LimitLOCKS\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"LimitSIGPENDING\" type=\"t\" access=\"read\"/>\ | ||||
n" \ | ||||
" <property name=\"LimitMSGQUEUE\" type=\"t\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"LimitNICE\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"LimitRTPRIO\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"LimitRTTIME\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"WorkingDirectory\" type=\"s\" access=\"read\"/> | ||||
\n" \ | ||||
" <property name=\"RootDirectory\" type=\"s\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"OOMScoreAdjust\" type=\"i\" access=\"read\"/>\n | ||||
" \ | ||||
" <property name=\"Nice\" type=\"i\" access=\"read\"/>\n" \ | ||||
" <property name=\"IOScheduling\" type=\"i\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"CPUSchedulingPolicy\" type=\"i\" access=\"read\ | ||||
"/>\n" \ | ||||
" <property name=\"CPUSchedulingPriority\" type=\"i\" access=\"rea | ||||
d\"/>\n" \ | ||||
" <property name=\"CPUAffinity\" type=\"ay\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"TimerSlackNSec\" type=\"t\" access=\"read\"/>\n | ||||
" \ | ||||
" <property name=\"CPUSchedulingResetOnFork\" type=\"b\" access=\" | ||||
read\"/>\n" \ | ||||
" <property name=\"NonBlocking\" type=\"b\" access=\"read\"/>\n" \ | ||||
" <property name=\"StandardInput\" type=\"s\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"StandardOutput\" type=\"s\" access=\"read\"/>\n | ||||
" \ | ||||
" <property name=\"StandardError\" type=\"s\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"TTYPath\" type=\"s\" access=\"read\"/>\n" \ | ||||
" <property name=\"TTYReset\" type=\"b\" access=\"read\"/>\n" \ | ||||
" <property name=\"TTYVHangup\" type=\"b\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"TTYVTDisallocate\" type=\"b\" access=\"read\"/> | ||||
\n" \ | ||||
" <property name=\"SyslogPriority\" type=\"i\" access=\"read\"/>\n | ||||
" \ | ||||
" <property name=\"SyslogIdentifier\" type=\"s\" access=\"read\"/> | ||||
\n" \ | ||||
" <property name=\"SyslogLevelPrefix\" type=\"b\" access=\"read\"/ | ||||
>\n" \ | ||||
" <property name=\"Capabilities\" type=\"s\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"SecureBits\" type=\"i\" access=\"read\"/>\n" \ | ||||
" <property name=\"CapabilityBoundingSet\" type=\"t\" access=\"rea | ||||
d\"/>\n" \ | ||||
" <property name=\"User\" type=\"s\" access=\"read\"/>\n" \ | ||||
" <property name=\"Group\" type=\"s\" access=\"read\"/>\n" \ | ||||
" <property name=\"SupplementaryGroups\" type=\"as\" access=\"read | ||||
\"/>\n" \ | ||||
" <property name=\"TCPWrapName\" type=\"s\" access=\"read\"/>\n" \ | ||||
" <property name=\"PAMName\" type=\"s\" access=\"read\"/>\n" \ | ||||
" <property name=\"ReadWriteDirectories\" type=\"as\" access=\"rea | ||||
d\"/>\n" \ | ||||
" <property name=\"ReadOnlyDirectories\" type=\"as\" access=\"read | ||||
\"/>\n" \ | ||||
" <property name=\"InaccessibleDirectories\" type=\"as\" access=\" | ||||
read\"/>\n" \ | ||||
" <property name=\"MountFlags\" type=\"t\" access=\"read\"/>\n" \ | ||||
" <property name=\"PrivateTmp\" type=\"b\" access=\"read\"/>\n" \ | ||||
" <property name=\"PrivateNetwork\" type=\"b\" access=\"read\"/>\n | ||||
" \ | ||||
" <property name=\"SameProcessGroup\" type=\"b\" access=\"read\"/> | ||||
\n" \ | ||||
" <property name=\"UtmpIdentifier\" type=\"s\" access=\"read\"/>\n | ||||
" \ | ||||
" <property name=\"IgnoreSIGPIPE\" type=\"b\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"NoNewPrivileges\" type=\"b\" access=\"read\"/>\ | ||||
n" \ | ||||
" <property name=\"SystemCallFilter\" type=\"au\" access=\"read\"/ | ||||
>\n" | ||||
#define BUS_EXEC_COMMAND_INTERFACE(name) \ | ||||
" <property name=\"" name "\" type=\"a(sasbttuii)\" access=\"read\ | ||||
"/>\n" | ||||
extern const BusProperty bus_exec_context_properties[]; | #define BUS_EXEC_COMMAND_LIST_VTABLE(name, offset, flags) | |||
\ | ||||
SD_BUS_PROPERTY(name, "a(sasbttttuii)", bus_property_get_exec_comma | ||||
nd_list, offset, flags) | ||||
#define BUS_EXEC_COMMAND_PROPERTY(name, command, indirect) \ | extern const sd_bus_vtable bus_exec_vtable[]; | |||
{ name, bus_execute_append_command, "a(sasbttttuii)", (command), (i | ||||
ndirect), NULL } | ||||
int bus_execute_append_command(DBusMessageIter *u, const char *property, vo | int bus_property_get_exec_output(sd_bus *bus, const char *path, const char | |||
id *data); | *interface, const char *property, sd_bus_message *reply, void *userdata, sd | |||
_bus_error *ret_error); | ||||
int bus_property_get_exec_command(sd_bus *bus, const char *path, const char | ||||
*interface, const char *property, sd_bus_message *reply, void *userdata, s | ||||
d_bus_error *ret_error); | ||||
int bus_property_get_exec_command_list(sd_bus *bus, const char *path, const | ||||
char *interface, const char *property, sd_bus_message *reply, void *userda | ||||
ta, sd_bus_error *ret_error); | ||||
int bus_exec_context_set_transient_property(Unit *u, ExecContext *c, const | ||||
char *name, sd_bus_message *message, UnitSetPropertiesMode mode, sd_bus_err | ||||
or *error); | ||||
End of changes. 6 change blocks. | ||||
121 lines changed or deleted | 21 lines changed or added | |||
dbus-job.h | dbus-job.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "job.h" | #include "job.h" | |||
extern const sd_bus_vtable bus_job_vtable[]; | ||||
void bus_job_send_change_signal(Job *j); | void bus_job_send_change_signal(Job *j); | |||
void bus_job_send_removed_signal(Job *j); | void bus_job_send_removed_signal(Job *j); | |||
extern const DBusObjectPathVTable bus_job_vtable; | ||||
extern const char bus_job_interface[]; | ||||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 3 lines changed or added | |||
dbus-kill.h | dbus-kill.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "unit.h" | ||||
#include "kill.h" | ||||
#include "manager.h" | extern const sd_bus_vtable bus_kill_vtable[]; | |||
#include "dbus-common.h" | ||||
#define BUS_KILL_CONTEXT_INTERFACE \ | int bus_kill_context_set_transient_property(Unit *u, KillContext *c, const | |||
" <property name=\"KillMode\" type=\"s\" access=\"read\"/>\n" \ | char *name, sd_bus_message *message, UnitSetPropertiesMode mode, sd_bus_err | |||
" <property name=\"KillSignal\" type=\"i\" access=\"read\"/>\n" \ | or *error); | |||
" <property name=\"SendSIGKILL\" type=\"b\" access=\"read\"/>\n" \ | ||||
" <property name=\"SendSIGHUP\" type=\"b\" access=\"read\"/>\n" | ||||
extern const BusProperty bus_kill_context_properties[]; | ||||
int bus_kill_context_set_transient_property(Unit *u, KillContext *c, const | ||||
char *name, DBusMessageIter *i, UnitSetPropertiesMode mode, DBusError *erro | ||||
r); | ||||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 4 lines changed or added | |||
dbus-manager.h | dbus-manager.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "manager.h" | ||||
extern const DBusObjectPathVTable bus_manager_vtable; | extern const sd_bus_vtable bus_manager_vtable[]; | |||
extern const char bus_manager_interface[]; | void bus_manager_send_finished(Manager *m, usec_t firmware_usec, usec_t loa | |||
der_usec, usec_t kernel_usec, usec_t initrd_usec, usec_t userspace_usec, us | ||||
ec_t total_usec); | ||||
void bus_manager_send_reloading(Manager *m, bool active); | ||||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 3 lines changed or added | |||
dbus-mount.h | dbus-mount.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_mount_message_handler(Unit *u, DBusConnection *c, DBu sMessage *message); | extern const sd_bus_vtable bus_mount_vtable[]; | |||
int bus_mount_set_property(Unit *u, const char *name, DBusMessageIter *i, U nitSetPropertiesMode mode, DBusError *error); | int bus_mount_set_property(Unit *u, const char *name, sd_bus_message *messa ge, UnitSetPropertiesMode mode, sd_bus_error *error); | |||
int bus_mount_commit_properties(Unit *u); | int bus_mount_commit_properties(Unit *u); | |||
extern const char bus_mount_interface[]; | ||||
extern const char bus_mount_invalidating_properties[]; | ||||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 3 lines changed or added | |||
dbus-path.h | dbus-path.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "unit.h" | extern const sd_bus_vtable bus_path_vtable[]; | |||
DBusHandlerResult bus_path_message_handler(Unit *u, DBusConnection *c, DBus | ||||
Message *message); | ||||
extern const char bus_path_interface[]; | ||||
extern const char bus_path_invalidating_properties[]; | ||||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
dbus-scope.h | dbus-scope.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_scope_message_handler(Unit *u, DBusConnection *c, DBu sMessage *message); | extern const sd_bus_vtable bus_scope_vtable[]; | |||
int bus_scope_set_property(Unit *u, const char *name, DBusMessageIter *i, U nitSetPropertiesMode mode, DBusError *error); | int bus_scope_set_property(Unit *u, const char *name, sd_bus_message *i, Un itSetPropertiesMode mode, sd_bus_error *error); | |||
int bus_scope_commit_properties(Unit *u); | int bus_scope_commit_properties(Unit *u); | |||
extern const char bus_scope_interface[]; | int bus_scope_send_request_stop(Scope *s); | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 3 lines changed or added | |||
dbus-service.h | dbus-service.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_service_message_handler(Unit *u, DBusConnection *c, D BusMessage *message); | extern const sd_bus_vtable bus_service_vtable[]; | |||
int bus_service_set_property(Unit *u, const char *name, DBusMessageIter *i, UnitSetPropertiesMode mode, DBusError *error); | int bus_service_set_property(Unit *u, const char *name, sd_bus_message *i, UnitSetPropertiesMode mode, sd_bus_error *error); | |||
int bus_service_commit_properties(Unit *u); | int bus_service_commit_properties(Unit *u); | |||
extern const char bus_service_interface[]; | ||||
extern const char bus_service_invalidating_properties[]; | ||||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 3 lines changed or added | |||
dbus-slice.h | dbus-slice.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_slice_message_handler(Unit *u, DBusConnection *c, DBu sMessage *message); | extern const sd_bus_vtable bus_slice_vtable[]; | |||
int bus_slice_set_property(Unit *u, const char *name, DBusMessageIter *i, U nitSetPropertiesMode mode, DBusError *error); | int bus_slice_set_property(Unit *u, const char *name, sd_bus_message *messa ge, UnitSetPropertiesMode mode, sd_bus_error *error); | |||
int bus_slice_commit_properties(Unit *u); | int bus_slice_commit_properties(Unit *u); | |||
extern const char bus_slice_interface[]; | ||||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 3 lines changed or added | |||
dbus-snapshot.h | dbus-snapshot.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "unit.h" | extern const sd_bus_vtable bus_snapshot_vtable[]; | |||
DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusConnection *c, | int bus_snapshot_method_remove(sd_bus *bus, sd_bus_message *message, void * | |||
DBusMessage *message); | userdata, sd_bus_error *error); | |||
extern const char bus_snapshot_interface[]; | ||||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
dbus-socket.h | dbus-socket.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_socket_message_handler(Unit *u, DBusConnection *c, DB usMessage *message); | extern const sd_bus_vtable bus_socket_vtable[]; | |||
int bus_socket_set_property(Unit *u, const char *name, DBusMessageIter *i, UnitSetPropertiesMode mode, DBusError *error); | int bus_socket_set_property(Unit *u, const char *name, sd_bus_message *mess age, UnitSetPropertiesMode mode, sd_bus_error *error); | |||
int bus_socket_commit_properties(Unit *u); | int bus_socket_commit_properties(Unit *u); | |||
extern const char bus_socket_interface[]; | ||||
extern const char bus_socket_invalidating_properties[]; | ||||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 3 lines changed or added | |||
dbus-swap.h | dbus-swap.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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_swap_message_handler(Unit *u, DBusConnection *c, DBus Message *message); | extern const sd_bus_vtable bus_swap_vtable[]; | |||
int bus_swap_set_property(Unit *u, const char *name, DBusMessageIter *i, Un itSetPropertiesMode mode, DBusError *error); | int bus_swap_set_property(Unit *u, const char *name, sd_bus_message *messag e, UnitSetPropertiesMode mode, sd_bus_error *error); | |||
int bus_swap_commit_properties(Unit *u); | int bus_swap_commit_properties(Unit *u); | |||
extern const char bus_swap_interface[]; | ||||
extern const char bus_swap_invalidating_properties[]; | ||||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 3 lines changed or added | |||
dbus-target.h | dbus-target.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "unit.h" | extern const sd_bus_vtable bus_target_vtable[]; | |||
DBusHandlerResult bus_target_message_handler(Unit *u, DBusConnection *c, DB | ||||
usMessage *message); | ||||
extern const char bus_target_interface[]; | ||||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
dbus-timer.h | dbus-timer.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "unit.h" | extern const sd_bus_vtable bus_timer_vtable[]; | |||
DBusHandlerResult bus_timer_message_handler(Unit *u, DBusConnection *c, DBu | ||||
sMessage *message); | ||||
extern const char bus_timer_interface[]; | ||||
extern const char bus_timer_invalidating_properties[]; | ||||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
dbus-unit.h | dbus-unit.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include "sd-bus.h" | |||
#include "unit.h" | ||||
#include "manager.h" | extern const sd_bus_vtable bus_unit_vtable[]; | |||
#include "dbus-common.h" | extern const sd_bus_vtable bus_unit_cgroup_vtable[]; | |||
#define BUS_UNIT_INTERFACE \ | ||||
" <interface name=\"org.freedesktop.systemd1.Unit\">\n" \ | ||||
" <method name=\"Start\">\n" \ | ||||
" <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | ||||
" <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | ||||
" </method>\n" \ | ||||
" <method name=\"Stop\">\n" \ | ||||
" <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | ||||
" <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | ||||
" </method>\n" \ | ||||
" <method name=\"Reload\">\n" \ | ||||
" <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | ||||
" <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | ||||
" </method>\n" \ | ||||
" <method name=\"Restart\">\n" \ | ||||
" <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | ||||
" <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | ||||
" </method>\n" \ | ||||
" <method name=\"TryRestart\">\n" \ | ||||
" <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | ||||
" <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | ||||
" </method>\n" \ | ||||
" <method name=\"ReloadOrRestart\">\n" \ | ||||
" <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | ||||
" <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | ||||
" </method>\n" \ | ||||
" <method name=\"ReloadOrTryRestart\">\n" \ | ||||
" <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | ||||
" <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | ||||
" </method>\n" \ | ||||
" <method name=\"Kill\">\n" \ | ||||
" <arg name=\"who\" type=\"s\" direction=\"in\"/>\n" \ | ||||
" <arg name=\"signal\" type=\"i\" direction=\"in\"/>\n" \ | ||||
" </method>\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=\"Names\" type=\"as\" access=\"read\"/>\n" \ | ||||
" <property name=\"Following\" type=\"s\" access=\"read\"/>\n" \ | ||||
" <property name=\"Requires\" type=\"as\" access=\"read\"/>\n" \ | ||||
" <property name=\"RequiresOverridable\" type=\"as\" access=\"read | ||||
\"/>\n" \ | ||||
" <property name=\"Requisite\" type=\"as\" access=\"read\"/>\n" \ | ||||
" <property name=\"RequisiteOverridable\" type=\"as\" access=\"rea | ||||
d\"/>\n" \ | ||||
" <property name=\"Wants\" type=\"as\" access=\"read\"/>\n" \ | ||||
" <property name=\"BindsTo\" type=\"as\" access=\"read\"/>\n" \ | ||||
" <property name=\"PartOf\" type=\"as\" access=\"read\"/>\n" \ | ||||
" <property name=\"RequiredBy\" type=\"as\" access=\"read\"/>\n" \ | ||||
" <property name=\"RequiredByOverridable\" type=\"as\" access=\"re | ||||
ad\"/>\n" \ | ||||
" <property name=\"WantedBy\" type=\"as\" access=\"read\"/>\n" \ | ||||
" <property name=\"BoundBy\" type=\"as\" access=\"read\"/>\n" \ | ||||
" <property name=\"ConsistsOf\" type=\"as\" access=\"read\"/>\n" \ | ||||
" <property name=\"Conflicts\" type=\"as\" access=\"read\"/>\n" \ | ||||
" <property name=\"ConflictedBy\" type=\"as\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"Before\" type=\"as\" access=\"read\"/>\n" \ | ||||
" <property name=\"After\" type=\"as\" access=\"read\"/>\n" \ | ||||
" <property name=\"OnFailure\" type=\"as\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"Triggers\" type=\"as\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"TriggeredBy\" type=\"as\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"PropagatesReloadTo\" type=\"as\" access=\"read\ | ||||
"/>\n" \ | ||||
" <property name=\"ReloadPropagatedFrom\" type=\"as\" access=\"rea | ||||
d\"/>\n" \ | ||||
" <property name=\"RequiresMountsFor\" type=\"as\" access=\"read\" | ||||
/>\n" \ | ||||
" <property name=\"Description\" type=\"s\" access=\"read\"/>\n" \ | ||||
" <property name=\"SourcePath\" type=\"s\" access=\"read\"/>\n" \ | ||||
" <property name=\"DropInPaths\" type=\"as\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"Documentation\" type=\"as\" access=\"read\"/>\n | ||||
" \ | ||||
" <property name=\"LoadState\" type=\"s\" access=\"read\"/>\n" \ | ||||
" <property name=\"ActiveState\" type=\"s\" access=\"read\"/>\n" \ | ||||
" <property name=\"SubState\" type=\"s\" access=\"read\"/>\n" \ | ||||
" <property name=\"FragmentPath\" type=\"s\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"UnitFileState\" type=\"s\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"InactiveExitTimestamp\" type=\"t\" access=\"rea | ||||
d\"/>\n" \ | ||||
" <property name=\"InactiveExitTimestampMonotonic\" type=\"t\" acc | ||||
ess=\"read\"/>\n" \ | ||||
" <property name=\"ActiveEnterTimestamp\" type=\"t\" access=\"read | ||||
\"/>\n" \ | ||||
" <property name=\"ActiveEnterTimestampMonotonic\" type=\"t\" acce | ||||
ss=\"read\"/>\n" \ | ||||
" <property name=\"ActiveExitTimestamp\" type=\"t\" access=\"read\ | ||||
"/>\n" \ | ||||
" <property name=\"ActiveExitTimestampMonotonic\" type=\"t\" acces | ||||
s=\"read\"/>\n" \ | ||||
" <property name=\"InactiveEnterTimestamp\" type=\"t\" access=\"re | ||||
ad\"/>\n" \ | ||||
" <property name=\"InactiveEnterTimestampMonotonic\" type=\"t\" ac | ||||
cess=\"read\"/>\n" \ | ||||
" <property name=\"CanStart\" type=\"b\" access=\"read\"/>\n" \ | ||||
" <property name=\"CanStop\" type=\"b\" access=\"read\"/>\n" \ | ||||
" <property name=\"CanReload\" type=\"b\" access=\"read\"/>\n" \ | ||||
" <property name=\"CanIsolate\" type=\"b\" access=\"read\"/>\n" \ | ||||
" <property name=\"Job\" type=\"(uo)\" access=\"read\"/>\n" \ | ||||
" <property name=\"StopWhenUnneeded\" type=\"b\" access=\"read\"/> | ||||
\n" \ | ||||
" <property name=\"RefuseManualStart\" type=\"b\" access=\"read\"/ | ||||
>\n" \ | ||||
" <property name=\"RefuseManualStop\" type=\"b\" access=\"read\"/> | ||||
\n" \ | ||||
" <property name=\"AllowIsolate\" type=\"b\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"DefaultDependencies\" type=\"b\" access=\"read\ | ||||
"/>\n" \ | ||||
" <property name=\"OnFailureIsolate\" type=\"b\" access=\"read\"/> | ||||
\n" \ | ||||
" <property name=\"IgnoreOnIsolate\" type=\"b\" access=\"read\"/>\ | ||||
n" \ | ||||
" <property name=\"IgnoreOnSnapshot\" type=\"b\" access=\"read\"/> | ||||
\n" \ | ||||
" <property name=\"NeedDaemonReload\" type=\"b\" access=\"read\"/> | ||||
\n" \ | ||||
" <property name=\"JobTimeoutUSec\" type=\"t\" access=\"read\"/>\n | ||||
" \ | ||||
" <property name=\"ConditionTimestamp\" type=\"t\" access=\"read\" | ||||
/>\n" \ | ||||
" <property name=\"ConditionTimestampMonotonic\" type=\"t\" access | ||||
=\"read\"/>\n" \ | ||||
" <property name=\"ConditionResult\" type=\"b\" access=\"read\"/>\ | ||||
n" \ | ||||
" <property name=\"Conditions\" type=\"a(sbbsi)\" access=\"read\"/ | ||||
>\n" \ | ||||
" <property name=\"LoadError\" type=\"(ss)\" access=\"read\"/>\n" | ||||
\ | ||||
" <property name=\"Transient\" type=\"b\" access=\"read\"/>\n" \ | ||||
" </interface>\n" | ||||
#define BUS_UNIT_CGROUP_INTERFACE \ | ||||
" <property name=\"Slice\" type=\"s\" access=\"read\"/>\n" \ | ||||
" <property name=\"ControlGroup\" type=\"s\" access=\"read\"/>\n" | ||||
#define BUS_UNIT_INTERFACES_LIST \ | ||||
BUS_GENERIC_INTERFACES_LIST \ | ||||
"org.freedesktop.systemd1.Unit\0" | ||||
extern const BusProperty bus_unit_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(DBusConnection *connection, DBusMessag | int bus_unit_method_start_generic(sd_bus *bus, sd_bus_message *message, Uni | |||
e *message, Unit *u, JobType type, JobMode mode, bool reload_if_possible); | t *u, JobType job_type, bool reload_if_possible, sd_bus_error *error); | |||
int bus_unit_method_kill(sd_bus *bus, sd_bus_message *message, void *userda | ||||
int bus_unit_set_properties(Unit *u, DBusMessageIter *i, UnitSetPropertiesM | ta, sd_bus_error *error); | |||
ode mode, bool commit, DBusError *error); | int bus_unit_method_reset_failed(sd_bus *bus, sd_bus_message *message, void | |||
*userdata, sd_bus_error *error); | ||||
extern const DBusObjectPathVTable bus_unit_vtable; | ||||
int bus_unit_queue_job(sd_bus *bus, sd_bus_message *message, Unit *u, JobTy | ||||
extern const char bus_unit_interface[]; | pe type, JobMode mode, bool reload_if_possible, sd_bus_error *error); | |||
int bus_unit_set_properties(Unit *u, sd_bus_message *message, UnitSetProper | ||||
tiesMode mode, bool commit, sd_bus_error *error); | ||||
int bus_unit_method_set_properties(sd_bus *bus, sd_bus_message *message, vo | ||||
id *userdata, sd_bus_error *error); | ||||
End of changes. 3 change blocks. | ||||
155 lines changed or deleted | 4 lines changed or added | |||
dbus.h | dbus.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | ||||
#include "manager.h" | #include "manager.h" | |||
int bus_send_queued_message(Manager *m); | ||||
int bus_init(Manager *m, bool try_bus_connect); | int bus_init(Manager *m, bool try_bus_connect); | |||
void bus_done(Manager *m); | void bus_done(Manager *m); | |||
unsigned bus_dispatch(Manager *m); | ||||
void bus_watch_event(Manager *m, Watch *w, int events); | ||||
void bus_timeout_event(Manager *m, Watch *w, int events); | ||||
int bus_query_pid(Manager *m, const char *name); | ||||
int bus_broadcast(Manager *m, DBusMessage *message); | ||||
bool bus_has_subscriber(Manager *m); | ||||
bool bus_connection_has_subscriber(Manager *m, DBusConnection *c); | ||||
int bus_fdset_add_all(Manager *m, FDSet *fds); | int bus_fdset_add_all(Manager *m, FDSet *fds); | |||
void bus_broadcast_finished(Manager *m, usec_t firmware_usec, usec_t loader | void bus_track_serialize(sd_bus_track *t, FILE *f); | |||
_usec, usec_t kernel_usec, usec_t initrd_usec, usec_t userspace_usec, usec_ | int bus_track_deserialize_item(char ***l, const char *line); | |||
t total_usec); | int bus_track_coldplug(Manager *m, sd_bus_track **t, char ***l); | |||
void bus_broadcast_reloading(Manager *m, bool active); | ||||
Set *bus_acquire_subscribed(Manager *m, DBusConnection *c); | ||||
void bus_serialize(Manager *m, FILE *f); | ||||
int bus_deserialize_item(Manager *m, const char *line); | ||||
#define BUS_CONNECTION_SUBSCRIBED(m, c) dbus_connection_get_data((c), (m)-> | ||||
subscribed_data_slot) | ||||
#define BUS_PENDING_CALL_NAME(m, p) dbus_pending_call_get_data((p), (m)->na | ||||
me_data_slot) | ||||
extern const char * const bus_interface_table[]; | int bus_foreach_bus(Manager *m, sd_bus_track *subscribed2, int (*send_messa ge)(sd_bus *bus, void *userdata), void *userdata); | |||
End of changes. 5 change blocks. | ||||
28 lines changed or deleted | 5 lines changed or added | |||
def.h | def.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 "util.h" | #include "util.h" | |||
#define DEFAULT_TIMEOUT_USEC (90*USEC_PER_SEC) | #define DEFAULT_TIMEOUT_USEC (90*USEC_PER_SEC) | |||
#define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC) | #define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC) | |||
#define DEFAULT_CONFIRM_USEC (30*USEC_PER_SEC) | #define DEFAULT_CONFIRM_USEC (30*USEC_PER_SEC) | |||
#define DEFAULT_EXIT_USEC (5*USEC_PER_MINUTE) | #define DEFAULT_START_LIMIT_INTERVAL (10*USEC_PER_SEC) | |||
#define DEFAULT_START_LIMIT_BURST 5 | ||||
/* The default time after which exit-on-idle services exit. This | ||||
* should be kept lower than the watchdog timeout, because otherwise | ||||
* the watchdog pings will keep the loop busy. */ | ||||
#define DEFAULT_EXIT_USEC (30*USEC_PER_SEC) | ||||
#define SYSTEMD_CGROUP_CONTROLLER "name=systemd" | #define SYSTEMD_CGROUP_CONTROLLER "name=systemd" | |||
#define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT | #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT | |||
#define SIGNALS_IGNORE SIGPIPE | #define SIGNALS_IGNORE SIGPIPE | |||
#define DIGITS "0123456789" | #define DIGITS "0123456789" | |||
#define LOWERCASE_LETTERS "abcdefghijklmnopqrstuvwxyz" | #define LOWERCASE_LETTERS "abcdefghijklmnopqrstuvwxyz" | |||
#define UPPERCASE_LETTERS "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | #define UPPERCASE_LETTERS "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |||
#define LETTERS LOWERCASE_LETTERS UPPERCASE_LETTERS | #define LETTERS LOWERCASE_LETTERS UPPERCASE_LETTERS | |||
#define ALPHANUMERICAL LETTERS DIGITS | ||||
#define REBOOT_PARAM_FILE "/run/systemd/reboot-param" | ||||
#ifdef HAVE_SPLIT_USR | ||||
#define KBD_KEYMAP_DIRS \ | ||||
"/usr/share/keymaps/\0" \ | ||||
"/usr/share/kbd/keymaps/\0" \ | ||||
"/usr/lib/kbd/keymaps/\0" \ | ||||
"/lib/kbd/keymaps/\0" | ||||
#else | ||||
#define KBD_KEYMAP_DIRS \ | ||||
"/usr/share/keymaps/\0" \ | ||||
"/usr/share/kbd/keymaps/\0" \ | ||||
"/usr/lib/kbd/keymaps/\0" | ||||
#endif | ||||
#define UNIX_SYSTEM_BUS_PATH "unix:path=/var/run/dbus/system_bus_socket" | ||||
#define KERNEL_SYSTEM_BUS_PATH "kernel:path=/dev/kdbus/0-system/bus" | ||||
#ifdef ENABLE_KDBUS | ||||
# define DEFAULT_SYSTEM_BUS_PATH KERNEL_SYSTEM_BUS_PATH ";" UNIX_SYSTEM_BU | ||||
S_PATH | ||||
#else | ||||
# define DEFAULT_SYSTEM_BUS_PATH UNIX_SYSTEM_BUS_PATH | ||||
#endif | ||||
#define UNIX_USER_BUS_FMT "unix:path=%s/bus" | ||||
#define KERNEL_USER_BUS_FMT "kernel:path=/dev/kdbus/"UID_FMT"-user/bus" | ||||
#ifndef TTY_GID | ||||
#define TTY_GID 5 | ||||
#endif | ||||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 7 lines changed or added | |||
dev-setup.h | dev-setup.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
void dev_setup(const char *pathprefix); | int dev_setup(const char *pathprefix); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
device.h | device.h | |||
---|---|---|---|---|
skipping to change at line 53 | skipping to change at line 53 | |||
different device nodes we might end up creating multiple | different device nodes we might end up creating multiple | |||
devices for the same sysfs path. We chain them up here. */ | devices for the same sysfs path. We chain them up here. */ | |||
LIST_FIELDS(struct Device, same_sysfs); | LIST_FIELDS(struct Device, same_sysfs); | |||
DeviceState state; | DeviceState state; | |||
}; | }; | |||
extern const UnitVTable device_vtable; | extern const UnitVTable device_vtable; | |||
void device_fd_event(Manager *m, int events); | ||||
const char* device_state_to_string(DeviceState i) _const_; | const char* device_state_to_string(DeviceState i) _const_; | |||
DeviceState device_state_from_string(const char *s) _pure_; | DeviceState device_state_from_string(const char *s) _pure_; | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 0 lines changed or added | |||
env-util.h | env-util.h | |||
---|---|---|---|---|
skipping to change at line 42 | skipping to change at line 42 | |||
char **strv_env_clean(char **l); | char **strv_env_clean(char **l); | |||
char **strv_env_clean_log(char **e, const char *message); | char **strv_env_clean_log(char **e, const char *message); | |||
bool strv_env_name_or_assignment_is_valid(char **l); | bool strv_env_name_or_assignment_is_valid(char **l); | |||
char **strv_env_merge(unsigned n_lists, ...); | char **strv_env_merge(unsigned n_lists, ...); | |||
char **strv_env_delete(char **x, unsigned n_lists, ...); /* New copy */ | char **strv_env_delete(char **x, unsigned n_lists, ...); /* New copy */ | |||
char **strv_env_set(char **x, const char *p); /* New copy ... */ | char **strv_env_set(char **x, const char *p); /* New copy ... */ | |||
char **strv_env_unset(char **l, const char *p); /* In place ... */ | char **strv_env_unset(char **l, const char *p); /* In place ... */ | |||
char **strv_env_unset_many(char **l, ...) _sentinel_; | ||||
char *strv_env_get_n(char **l, const char *name, size_t k) _pure_; | char *strv_env_get_n(char **l, const char *name, size_t k) _pure_; | |||
char *strv_env_get(char **x, const char *n) _pure_; | char *strv_env_get(char **x, const char *n) _pure_; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
execute.h | execute.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
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 ExecStatus ExecStatus; | typedef struct ExecStatus ExecStatus; | |||
typedef struct ExecCommand ExecCommand; | typedef struct ExecCommand ExecCommand; | |||
typedef struct ExecContext ExecContext; | typedef struct ExecContext ExecContext; | |||
typedef struct ExecRuntime ExecRuntime; | ||||
#include <linux/types.h> | #include <linux/types.h> | |||
#include <sys/time.h> | #include <sys/time.h> | |||
#include <sys/resource.h> | #include <sys/resource.h> | |||
#include <sys/capability.h> | #include <sys/capability.h> | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#include <sched.h> | #include <sched.h> | |||
#include "list.h" | #include "list.h" | |||
#include "util.h" | #include "util.h" | |||
#include "set.h" | ||||
typedef struct Unit Unit; | #include "fdset.h" | |||
#include "missing.h" | ||||
#include "namespace.h" | ||||
typedef enum ExecInput { | typedef enum ExecInput { | |||
EXEC_INPUT_NULL, | EXEC_INPUT_NULL, | |||
EXEC_INPUT_TTY, | EXEC_INPUT_TTY, | |||
EXEC_INPUT_TTY_FORCE, | EXEC_INPUT_TTY_FORCE, | |||
EXEC_INPUT_TTY_FAIL, | EXEC_INPUT_TTY_FAIL, | |||
EXEC_INPUT_SOCKET, | EXEC_INPUT_SOCKET, | |||
_EXEC_INPUT_MAX, | _EXEC_INPUT_MAX, | |||
_EXEC_INPUT_INVALID = -1 | _EXEC_INPUT_INVALID = -1 | |||
} ExecInput; | } ExecInput; | |||
skipping to change at line 82 | skipping to change at line 85 | |||
}; | }; | |||
struct ExecCommand { | struct ExecCommand { | |||
char *path; | char *path; | |||
char **argv; | char **argv; | |||
ExecStatus exec_status; | ExecStatus exec_status; | |||
LIST_FIELDS(ExecCommand, command); /* useful for chaining commands */ | LIST_FIELDS(ExecCommand, command); /* useful for chaining commands */ | |||
bool ignore; | bool ignore; | |||
}; | }; | |||
struct ExecRuntime { | ||||
int n_ref; | ||||
char *tmp_dir; | ||||
char *var_tmp_dir; | ||||
int netns_storage_socket[2]; | ||||
}; | ||||
struct ExecContext { | struct ExecContext { | |||
char **environment; | char **environment; | |||
char **environment_files; | char **environment_files; | |||
struct rlimit *rlimit[RLIMIT_NLIMITS]; | struct rlimit *rlimit[_RLIMIT_MAX]; | |||
char *working_directory, *root_directory; | char *working_directory, *root_directory; | |||
mode_t umask; | mode_t umask; | |||
int oom_score_adjust; | int oom_score_adjust; | |||
int nice; | int nice; | |||
int ioprio; | int ioprio; | |||
int cpu_sched_policy; | int cpu_sched_policy; | |||
int cpu_sched_priority; | int cpu_sched_priority; | |||
cpu_set_t *cpuset; | cpu_set_t *cpuset; | |||
unsigned cpuset_ncpus; | unsigned cpuset_ncpus; | |||
ExecInput std_input; | ExecInput std_input; | |||
ExecOutput std_output; | ExecOutput std_output; | |||
ExecOutput std_error; | ExecOutput std_error; | |||
nsec_t timer_slack_nsec; | nsec_t timer_slack_nsec; | |||
char *tcpwrap_name; | ||||
char *tty_path; | char *tty_path; | |||
bool tty_reset; | bool tty_reset; | |||
bool tty_vhangup; | bool tty_vhangup; | |||
bool tty_vt_disallocate; | bool tty_vt_disallocate; | |||
bool ignore_sigpipe; | bool ignore_sigpipe; | |||
/* Since resolving these names might might involve socket | /* Since resolving these names might might involve socket | |||
* connections and we don't want to deadlock ourselves these | * connections and we don't want to deadlock ourselves these | |||
* names are resolved on execution only and in the child | * names are resolved on execution only and in the child | |||
* process. */ | * process. */ | |||
char *user; | char *user; | |||
char *group; | char *group; | |||
char **supplementary_groups; | char **supplementary_groups; | |||
char *pam_name; | char *pam_name; | |||
char *utmp_id; | char *utmp_id; | |||
bool selinux_context_ignore; | ||||
char *selinux_context; | ||||
bool apparmor_profile_ignore; | ||||
char *apparmor_profile; | ||||
char **read_write_dirs, **read_only_dirs, **inaccessible_dirs; | char **read_write_dirs, **read_only_dirs, **inaccessible_dirs; | |||
unsigned long mount_flags; | unsigned long mount_flags; | |||
uint64_t capability_bounding_set_drop; | uint64_t capability_bounding_set_drop; | |||
cap_t capabilities; | cap_t capabilities; | |||
int secure_bits; | int secure_bits; | |||
int syslog_priority; | int syslog_priority; | |||
char *syslog_identifier; | char *syslog_identifier; | |||
bool syslog_level_prefix; | bool syslog_level_prefix; | |||
bool cpu_sched_reset_on_fork; | bool cpu_sched_reset_on_fork; | |||
bool non_blocking; | bool non_blocking; | |||
bool private_tmp; | bool private_tmp; | |||
bool private_network; | bool private_network; | |||
char *tmp_dir; | bool private_devices; | |||
char *var_tmp_dir; | ProtectSystem protect_system; | |||
ProtectHome protect_home; | ||||
bool no_new_privileges; | bool no_new_privileges; | |||
/* This is not exposed to the user but available | /* This is not exposed to the user but available | |||
* internally. We need it to make sure that whenever we spawn | * internally. We need it to make sure that whenever we spawn | |||
* /bin/mount it is run in the same process group as us so | * /bin/mount it is run in the same process group as us so | |||
* that the autofs logic detects that it belongs to us and we | * that the autofs logic detects that it belongs to us and we | |||
* don't enter a trigger loop. */ | * don't enter a trigger loop. */ | |||
bool same_pgrp; | bool same_pgrp; | |||
uint32_t *syscall_filter; | unsigned long personality; | |||
Set *syscall_filter; | ||||
Set *syscall_archs; | ||||
int syscall_errno; | ||||
bool syscall_whitelist:1; | ||||
Set *address_families; | ||||
bool address_families_whitelist:1; | ||||
char **runtime_directory; | ||||
mode_t runtime_directory_mode; | ||||
bool oom_score_adjust_set:1; | bool oom_score_adjust_set:1; | |||
bool nice_set:1; | bool nice_set:1; | |||
bool ioprio_set:1; | bool ioprio_set:1; | |||
bool cpu_sched_set:1; | bool cpu_sched_set:1; | |||
bool no_new_privileges_set:1; | ||||
}; | }; | |||
#include "cgroup.h" | #include "cgroup.h" | |||
int exec_spawn(ExecCommand *command, | int exec_spawn(ExecCommand *command, | |||
char **argv, | char **argv, | |||
ExecContext *context, | ExecContext *context, | |||
int fds[], unsigned n_fds, | int fds[], unsigned n_fds, | |||
char **environment, | char **environment, | |||
bool apply_permissions, | bool apply_permissions, | |||
bool apply_chroot, | bool apply_chroot, | |||
bool apply_tty_stdin, | bool apply_tty_stdin, | |||
bool confirm_spawn, | bool confirm_spawn, | |||
CGroupControllerMask cgroup_mask, | CGroupControllerMask cgroup_mask, | |||
const char *cgroup_path, | const char *cgroup_path, | |||
const char *runtime_prefix, | ||||
const char *unit_id, | const char *unit_id, | |||
usec_t watchdog_usec, | ||||
int pipe_fd[2], | int pipe_fd[2], | |||
ExecRuntime *runtime, | ||||
pid_t *ret); | pid_t *ret); | |||
void exec_command_done(ExecCommand *c); | void exec_command_done(ExecCommand *c); | |||
void exec_command_done_array(ExecCommand *c, unsigned n); | void exec_command_done_array(ExecCommand *c, unsigned n); | |||
void exec_command_free_list(ExecCommand *c); | void exec_command_free_list(ExecCommand *c); | |||
void exec_command_free_array(ExecCommand **c, unsigned n); | void exec_command_free_array(ExecCommand **c, unsigned n); | |||
char *exec_command_line(char **argv); | char *exec_command_line(char **argv); | |||
void exec_command_dump(ExecCommand *c, FILE *f, const char *prefix); | void exec_command_dump(ExecCommand *c, FILE *f, const char *prefix); | |||
void exec_command_dump_list(ExecCommand *c, FILE *f, const char *prefix); | void exec_command_dump_list(ExecCommand *c, FILE *f, const char *prefix); | |||
void exec_command_append_list(ExecCommand **l, ExecCommand *e); | void exec_command_append_list(ExecCommand **l, ExecCommand *e); | |||
int exec_command_set(ExecCommand *c, const char *path, ...); | int exec_command_set(ExecCommand *c, const char *path, ...); | |||
void exec_context_init(ExecContext *c); | void exec_context_init(ExecContext *c); | |||
void exec_context_done(ExecContext *c, bool reloading_or_reexecuting); | void exec_context_done(ExecContext *c); | |||
void exec_context_tmp_dirs_done(ExecContext *c); | ||||
void exec_context_dump(ExecContext *c, FILE* f, const char *prefix); | void exec_context_dump(ExecContext *c, FILE* f, const char *prefix); | |||
void exec_context_tty_reset(const ExecContext *context); | ||||
int exec_context_destroy_runtime_directory(ExecContext *c, const char *runt | ||||
ime_root); | ||||
int exec_context_load_environment(const ExecContext *c, char ***l); | int exec_context_load_environment(const ExecContext *c, char ***l); | |||
bool exec_context_may_touch_console(ExecContext *c); | bool exec_context_may_touch_console(ExecContext *c); | |||
void exec_context_serialize(const ExecContext *c, Unit *u, FILE *f); | ||||
void exec_status_start(ExecStatus *s, pid_t pid); | void exec_status_start(ExecStatus *s, pid_t pid); | |||
void exec_status_exit(ExecStatus *s, ExecContext *context, pid_t pid, int c ode, int status); | void exec_status_exit(ExecStatus *s, ExecContext *context, pid_t pid, int c ode, int status); | |||
void exec_status_dump(ExecStatus *s, FILE *f, const char *prefix); | void exec_status_dump(ExecStatus *s, FILE *f, const char *prefix); | |||
int exec_runtime_make(ExecRuntime **rt, ExecContext *c, const char *id); | ||||
ExecRuntime *exec_runtime_ref(ExecRuntime *r); | ||||
ExecRuntime *exec_runtime_unref(ExecRuntime *r); | ||||
int exec_runtime_serialize(ExecRuntime *rt, Unit *u, FILE *f, FDSet *fds); | ||||
int exec_runtime_deserialize_item(ExecRuntime **rt, Unit *u, const char *ke | ||||
y, const char *value, FDSet *fds); | ||||
void exec_runtime_destroy(ExecRuntime *rt); | ||||
const char* exec_output_to_string(ExecOutput i) _const_; | const char* exec_output_to_string(ExecOutput i) _const_; | |||
ExecOutput exec_output_from_string(const char *s) _pure_; | ExecOutput exec_output_from_string(const char *s) _pure_; | |||
const char* exec_input_to_string(ExecInput i) _const_; | const char* exec_input_to_string(ExecInput i) _const_; | |||
ExecInput exec_input_from_string(const char *s) _pure_; | ExecInput exec_input_from_string(const char *s) _pure_; | |||
End of changes. 16 change blocks. | ||||
12 lines changed or deleted | 54 lines changed or added | |||
exit-status.h | exit-status.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/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include "set.h" | #include "set.h" | |||
typedef enum ExitStatus { | typedef enum ExitStatus { | |||
/* EXIT_SUCCESS defined by libc */ | /* EXIT_SUCCESS defined by libc */ | |||
/* EXIT_FAILURE defined by libc */ | /* EXIT_FAILURE defined by libc */ | |||
EXIT_INVALIDARGUMENT = 2, | EXIT_INVALIDARGUMENT = 2, | |||
EXIT_NOTIMPLEMENTED = 3, | EXIT_NOTIMPLEMENTED = 3, | |||
EXIT_NOPERMISSION = 4, | EXIT_NOPERMISSION = 4, | |||
EXIT_NOTINSTALLED = 5, | EXIT_NOTINSTALLED = 5, | |||
EXIT_NOTCONFIGURED = 6, | EXIT_NOTCONFIGURED = 6, | |||
EXIT_NOTRUNNING = 7, | EXIT_NOTRUNNING = 7, | |||
skipping to change at line 65 | skipping to change at line 67 | |||
EXIT_SECUREBITS, | EXIT_SECUREBITS, | |||
EXIT_SETSCHEDULER, | EXIT_SETSCHEDULER, | |||
EXIT_CPUAFFINITY, | EXIT_CPUAFFINITY, | |||
EXIT_GROUP, | EXIT_GROUP, | |||
EXIT_USER, | EXIT_USER, | |||
EXIT_CAPABILITIES, | EXIT_CAPABILITIES, | |||
EXIT_CGROUP, | EXIT_CGROUP, | |||
EXIT_SETSID, /* 220 */ | EXIT_SETSID, /* 220 */ | |||
EXIT_CONFIRM, | EXIT_CONFIRM, | |||
EXIT_STDERR, | EXIT_STDERR, | |||
EXIT_TCPWRAP, | _EXIT_RESERVED, /* used to be tcpwrap, don't reuse! */ | |||
EXIT_PAM, | EXIT_PAM, | |||
EXIT_NETWORK, | EXIT_NETWORK, | |||
EXIT_NAMESPACE, | EXIT_NAMESPACE, | |||
EXIT_NO_NEW_PRIVILEGES, | EXIT_NO_NEW_PRIVILEGES, | |||
EXIT_SECCOMP | EXIT_SECCOMP, | |||
EXIT_SELINUX_CONTEXT, | ||||
EXIT_PERSONALITY, /* 230 */ | ||||
EXIT_APPARMOR_PROFILE, | ||||
EXIT_ADDRESS_FAMILIES, | ||||
EXIT_RUNTIME_DIRECTORY, | ||||
EXIT_MAKE_STARTER, | ||||
EXIT_CHOWN, | ||||
} ExitStatus; | } ExitStatus; | |||
typedef enum ExitStatusLevel { | typedef enum ExitStatusLevel { | |||
EXIT_STATUS_MINIMAL, | EXIT_STATUS_MINIMAL, | |||
EXIT_STATUS_SYSTEMD, | EXIT_STATUS_SYSTEMD, | |||
EXIT_STATUS_LSB, | EXIT_STATUS_LSB, | |||
EXIT_STATUS_FULL = EXIT_STATUS_LSB | EXIT_STATUS_FULL = EXIT_STATUS_LSB | |||
} ExitStatusLevel; | } ExitStatusLevel; | |||
typedef struct ExitStatusSet { | typedef struct ExitStatusSet { | |||
Set *code; | Set *status; | |||
Set *signal; | Set *signal; | |||
} ExitStatusSet; | } ExitStatusSet; | |||
const char* exit_status_to_string(ExitStatus status, ExitStatusLevel level) _const_; | const char* exit_status_to_string(ExitStatus status, ExitStatusLevel level) _const_; | |||
bool is_clean_exit(int code, int status, ExitStatusSet *success_status); | bool is_clean_exit(int code, int status, ExitStatusSet *success_status); | |||
bool is_clean_exit_lsb(int code, int status, ExitStatusSet *success_status) ; | bool is_clean_exit_lsb(int code, int status, ExitStatusSet *success_status) ; | |||
void exit_status_set_free(ExitStatusSet *x); | ||||
bool exit_status_set_is_empty(ExitStatusSet *x); | ||||
End of changes. 6 change blocks. | ||||
3 lines changed or deleted | 12 lines changed or added | |||
fdset.h | fdset.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/>. | |||
***/ | ***/ | |||
#include "set.h" | #include "set.h" | |||
#include "util.h" | ||||
typedef struct FDSet FDSet; | typedef struct FDSet FDSet; | |||
FDSet* fdset_new(void); | FDSet* fdset_new(void); | |||
void fdset_free(FDSet *s); | void fdset_free(FDSet *s); | |||
int fdset_put(FDSet *s, int fd); | int fdset_put(FDSet *s, int fd); | |||
int fdset_put_dup(FDSet *s, int fd); | int fdset_put_dup(FDSet *s, int fd); | |||
bool fdset_contains(FDSet *s, int fd); | bool fdset_contains(FDSet *s, int fd); | |||
skipping to change at line 50 | skipping to change at line 51 | |||
int fdset_cloexec(FDSet *fds, bool b); | int fdset_cloexec(FDSet *fds, bool b); | |||
int fdset_close_others(FDSet *fds); | int fdset_close_others(FDSet *fds); | |||
unsigned fdset_size(FDSet *fds); | unsigned fdset_size(FDSet *fds); | |||
int fdset_iterate(FDSet *s, Iterator *i); | int fdset_iterate(FDSet *s, Iterator *i); | |||
#define FDSET_FOREACH(fd, fds, i) \ | #define FDSET_FOREACH(fd, fds, i) \ | |||
for ((i) = ITERATOR_FIRST, (fd) = fdset_iterate((fds), &(i)); (fd) >= 0; (fd) = fdset_iterate((fds), &(i))) | for ((i) = ITERATOR_FIRST, (fd) = fdset_iterate((fds), &(i)); (fd) >= 0; (fd) = fdset_iterate((fds), &(i))) | |||
DEFINE_TRIVIAL_CLEANUP_FUNC(FDSet*, fdset_free); | ||||
#define _cleanup_fdset_free_ _cleanup_(fdset_freep) | ||||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
fileio.h | fileio.h | |||
---|---|---|---|---|
skipping to change at line 28 | skipping to change at line 28 | |||
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/>. | |||
***/ | ***/ | |||
#include <stddef.h> | #include <stddef.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#include "macro.h" | #include "macro.h" | |||
int write_string_to_file(FILE *f, const char *line); | int write_string_stream(FILE *f, const char *line); | |||
int write_string_file(const char *fn, const char *line); | int write_string_file(const char *fn, const char *line); | |||
int write_string_file_atomic(const char *fn, const char *line); | int write_string_file_atomic(const char *fn, const char *line); | |||
int read_one_line_file(const char *fn, char **line); | int read_one_line_file(const char *fn, char **line); | |||
int read_full_file(const char *fn, char **contents, size_t *size); | int read_full_file(const char *fn, char **contents, size_t *size); | |||
int read_full_stream(FILE *f, char **contents, size_t *size); | ||||
ssize_t sendfile_full(int out_fd, const char *fn); | ||||
int parse_env_file(const char *fname, const char *separator, ...) _sentinel _; | int parse_env_file(const char *fname, const char *separator, ...) _sentinel _; | |||
int load_env_file(const char *fname, const char *separator, char ***l); | int load_env_file(FILE *f, const char *fname, const char *separator, char * | |||
**l); | ||||
int load_env_file_pairs(FILE *f, const char *fname, const char *separator, | ||||
char ***l); | ||||
int write_env_file(const char *fname, char **l); | int write_env_file(const char *fname, char **l); | |||
int executable_is_script(const char *path, char **interpreter); | int executable_is_script(const char *path, char **interpreter); | |||
int get_status_field(const char *filename, const char *pattern, char **fiel d); | int get_status_field(const char *filename, const char *pattern, char **fiel d); | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 8 lines changed or added | |||
gudevdevice.h | gudevdevice.h | |||
---|---|---|---|---|
skipping to change at line 111 | skipping to change at line 111 | |||
const gchar * key); | const gchar * key); | |||
guint64 g_udev_device_get_property_as_uint64 (GUdevDevice * device, | guint64 g_udev_device_get_property_as_uint64 (GUdevDevice * device, | |||
const gchar * key); | const gchar * key); | |||
gdouble g_udev_device_get_property_as_double (GUdevDevice * device, | gdouble g_udev_device_get_property_as_double (GUdevDevice * device, | |||
const gchar * key); | const gchar * key); | |||
gboolean g_udev_device_get_property_as_boolean (GUdevDevice * device, | gboolean g_udev_device_get_property_as_boolean (GUdevDevice * device, | |||
const gchar * key); | const gchar * key); | |||
const gchar* const *g_udev_device_get_property_as_strv (GUdevDevice * device, | const gchar* const *g_udev_device_get_property_as_strv (GUdevDevice * device, | |||
const gchar * key); | const gchar * key); | |||
const gchar* const *g_udev_device_get_sysfs_attr_keys (GUdevDevice * | ||||
device); | ||||
gboolean g_udev_device_has_sysfs_attr (GUdevDevice * | ||||
device, | ||||
const gchar * | ||||
key); | ||||
const gchar *g_udev_device_get_sysfs_attr (GUdevDevice * device, | const gchar *g_udev_device_get_sysfs_attr (GUdevDevice * device, | |||
const gchar * name); | const gchar * name); | |||
gint g_udev_device_get_sysfs_attr_as_int (GUdevDevice * device, | gint g_udev_device_get_sysfs_attr_as_int (GUdevDevice * device, | |||
const gchar * name); | const gchar * name); | |||
guint64 g_udev_device_get_sysfs_attr_as_uint64 (GUdevDevice * device, | guint64 g_udev_device_get_sysfs_attr_as_uint64 (GUdevDevice * device, | |||
const gchar * name); | const gchar * name); | |||
gdouble g_udev_device_get_sysfs_attr_as_double (GUdevDevice * device, | gdouble g_udev_device_get_sysfs_attr_as_double (GUdevDevice * device, | |||
const gchar * name); | const gchar * name); | |||
gboolean g_udev_device_get_sysfs_attr_as_boolean (GUdevDevice * device, | gboolean g_udev_device_get_sysfs_attr_as_boolean (GUdevDevice * device, | |||
const gchar * name); | const gchar * name); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 6 lines changed or added | |||
hashmap.h | hashmap.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
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/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include "macro.h" | #include "macro.h" | |||
#include "util.h" | ||||
/* Pretty straightforward hash table implementation. As a minor | /* Pretty straightforward hash table implementation. As a minor | |||
* optimization a NULL hashmap object will be treated as empty hashmap | * optimization a NULL hashmap object will be treated as empty hashmap | |||
* for all read operations. That way it is not necessary to | * for all read operations. That way it is not necessary to | |||
* instantiate an object for each Hashmap use. */ | * instantiate an object for each Hashmap use. */ | |||
#define HASH_KEY_SIZE 16 | ||||
typedef struct Hashmap Hashmap; | typedef struct Hashmap Hashmap; | |||
typedef struct _IteratorStruct _IteratorStruct; | typedef struct _IteratorStruct _IteratorStruct; | |||
typedef _IteratorStruct* Iterator; | typedef _IteratorStruct* Iterator; | |||
#define ITERATOR_FIRST ((Iterator) 0) | #define ITERATOR_FIRST ((Iterator) 0) | |||
#define ITERATOR_LAST ((Iterator) -1) | #define ITERATOR_LAST ((Iterator) -1) | |||
typedef unsigned (*hash_func_t)(const void *p); | typedef unsigned long (*hash_func_t)(const void *p, const uint8_t hash_key[ HASH_KEY_SIZE]); | |||
typedef int (*compare_func_t)(const void *a, const void *b); | typedef int (*compare_func_t)(const void *a, const void *b); | |||
unsigned string_hash_func(const void *p) _pure_; | unsigned long string_hash_func(const void *p, const uint8_t hash_key[HASH_K EY_SIZE]) _pure_; | |||
int string_compare_func(const void *a, const void *b) _pure_; | int string_compare_func(const void *a, const void *b) _pure_; | |||
/* This will compare the passed pointers directly, and will not | /* This will compare the passed pointers directly, and will not | |||
* dereference them. This is hence not useful for strings or | * dereference them. This is hence not useful for strings or | |||
* suchlike. */ | * suchlike. */ | |||
unsigned trivial_hash_func(const void *p) _const_; | unsigned long trivial_hash_func(const void *p, const uint8_t hash_key[HASH_ KEY_SIZE]) _pure_; | |||
int trivial_compare_func(const void *a, const void *b) _const_; | int trivial_compare_func(const void *a, const void *b) _const_; | |||
unsigned uint64_hash_func(const void *p) _pure_; | unsigned long uint64_hash_func(const void *p, const uint8_t hash_key[HASH_K EY_SIZE]) _pure_; | |||
int uint64_compare_func(const void *a, const void *b) _pure_; | int uint64_compare_func(const void *a, const void *b) _pure_; | |||
Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func); | Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func); | |||
void hashmap_free(Hashmap *h); | void hashmap_free(Hashmap *h); | |||
void hashmap_free_free(Hashmap *h); | void hashmap_free_free(Hashmap *h); | |||
void hashmap_free_free_free(Hashmap *h); | void hashmap_free_free_free(Hashmap *h); | |||
Hashmap *hashmap_copy(Hashmap *h); | Hashmap *hashmap_copy(Hashmap *h); | |||
int hashmap_ensure_allocated(Hashmap **h, hash_func_t hash_func, compare_fu nc_t compare_func); | int hashmap_ensure_allocated(Hashmap **h, hash_func_t hash_func, compare_fu nc_t compare_func); | |||
int hashmap_put(Hashmap *h, const void *key, void *value); | int hashmap_put(Hashmap *h, const void *key, void *value); | |||
int hashmap_update(Hashmap *h, const void *key, void *value); | int hashmap_update(Hashmap *h, const void *key, void *value); | |||
int hashmap_replace(Hashmap *h, const void *key, void *value); | int hashmap_replace(Hashmap *h, const void *key, void *value); | |||
void *hashmap_get(Hashmap *h, const void *key); | void *hashmap_get(Hashmap *h, const void *key); | |||
void *hashmap_get2(Hashmap *h, const void *key, void **rkey); | void *hashmap_get2(Hashmap *h, const void *key, void **rkey); | |||
bool hashmap_contains(Hashmap *h, const void *key); | bool hashmap_contains(Hashmap *h, const void *key); | |||
void *hashmap_remove(Hashmap *h, const void *key); | void *hashmap_remove(Hashmap *h, const void *key); | |||
void *hashmap_remove2(Hashmap *h, const void *key, void **rkey); | ||||
void *hashmap_remove_value(Hashmap *h, const void *key, void *value); | void *hashmap_remove_value(Hashmap *h, const void *key, void *value); | |||
int hashmap_remove_and_put(Hashmap *h, const void *old_key, const void *new _key, void *value); | int hashmap_remove_and_put(Hashmap *h, const void *old_key, const void *new _key, void *value); | |||
int hashmap_remove_and_replace(Hashmap *h, const void *old_key, const void *new_key, void *value); | int hashmap_remove_and_replace(Hashmap *h, const void *old_key, const void *new_key, void *value); | |||
int hashmap_merge(Hashmap *h, Hashmap *other); | int hashmap_merge(Hashmap *h, Hashmap *other); | |||
void hashmap_move(Hashmap *h, Hashmap *other); | void hashmap_move(Hashmap *h, Hashmap *other); | |||
int hashmap_move_one(Hashmap *h, Hashmap *other, const void *key); | int hashmap_move_one(Hashmap *h, Hashmap *other, const void *key); | |||
unsigned hashmap_size(Hashmap *h) _pure_; | unsigned hashmap_size(Hashmap *h) _pure_; | |||
bool hashmap_isempty(Hashmap *h) _pure_; | bool hashmap_isempty(Hashmap *h) _pure_; | |||
skipping to change at line 107 | skipping to change at line 111 | |||
char **hashmap_get_strv(Hashmap *h); | char **hashmap_get_strv(Hashmap *h); | |||
#define HASHMAP_FOREACH(e, h, i) \ | #define HASHMAP_FOREACH(e, h, i) \ | |||
for ((i) = ITERATOR_FIRST, (e) = hashmap_iterate((h), &(i), NULL); (e); (e) = hashmap_iterate((h), &(i), NULL)) | for ((i) = ITERATOR_FIRST, (e) = hashmap_iterate((h), &(i), NULL); (e); (e) = hashmap_iterate((h), &(i), NULL)) | |||
#define HASHMAP_FOREACH_KEY(e, k, h, i) \ | #define HASHMAP_FOREACH_KEY(e, k, h, i) \ | |||
for ((i) = ITERATOR_FIRST, (e) = hashmap_iterate((h), &(i), (const void**) &(k)); (e); (e) = hashmap_iterate((h), &(i), (const void**) &(k))) | for ((i) = ITERATOR_FIRST, (e) = hashmap_iterate((h), &(i), (const void**) &(k)); (e); (e) = hashmap_iterate((h), &(i), (const void**) &(k))) | |||
#define HASHMAP_FOREACH_BACKWARDS(e, h, i) \ | #define HASHMAP_FOREACH_BACKWARDS(e, h, i) \ | |||
for ((i) = ITERATOR_LAST, (e) = hashmap_iterate_backwards((h), &(i) , NULL); (e); (e) = hashmap_iterate_backwards((h), &(i), NULL)) | for ((i) = ITERATOR_LAST, (e) = hashmap_iterate_backwards((h), &(i) , NULL); (e); (e) = hashmap_iterate_backwards((h), &(i), NULL)) | |||
DEFINE_TRIVIAL_CLEANUP_FUNC(Hashmap*, hashmap_free); | ||||
DEFINE_TRIVIAL_CLEANUP_FUNC(Hashmap*, hashmap_free_free); | ||||
DEFINE_TRIVIAL_CLEANUP_FUNC(Hashmap*, hashmap_free_free_free); | ||||
#define _cleanup_hashmap_free_ _cleanup_(hashmap_freep) | ||||
#define _cleanup_hashmap_free_free_ _cleanup_(hashmap_free_freep) | ||||
#define _cleanup_hashmap_free_free_free_ _cleanup_(hashmap_free_free_freep) | ||||
End of changes. 8 change blocks. | ||||
4 lines changed or deleted | 8 lines changed or added | |||
ifconf.h | ifconf.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooifconfhfoo | #pragma once | |||
#define fooifconfhfoo | ||||
#include <sys/socket.h> | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2008-2011 Lennart Poettering | Copyright 2008-2011 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. | |||
skipping to change at line 30 | skipping to change at line 27 | |||
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/>. | |||
***/ | ***/ | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <assert.h> | #include <assert.h> | |||
#include <sys/socket.h> | ||||
struct address { | struct address { | |||
unsigned char family; | unsigned char family; | |||
uint8_t address[16]; | uint8_t address[16]; | |||
unsigned char scope; | unsigned char scope; | |||
int ifindex; | int ifindex; | |||
}; | }; | |||
#define _public_ __attribute__ ((visibility("default"))) | #define _public_ __attribute__ ((visibility("default"))) | |||
#define _hidden_ __attribute__ ((visibility("hidden"))) | #define _hidden_ __attribute__ ((visibility("hidden"))) | |||
skipping to change at line 71 | skipping to change at line 69 | |||
if (a->family == AF_INET6 && b->family == AF_INET) | if (a->family == AF_INET6 && b->family == AF_INET) | |||
return 1; | return 1; | |||
if (a->ifindex < b->ifindex) | if (a->ifindex < b->ifindex) | |||
return -1; | return -1; | |||
if (a->ifindex > b->ifindex) | if (a->ifindex > b->ifindex) | |||
return 1; | return 1; | |||
return 0; | return 0; | |||
} | } | |||
#endif | ||||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 2 lines changed or added | |||
initreq.h | initreq.h | |||
---|---|---|---|---|
skipping to change at line 48 | skipping to change at line 48 | |||
# define INITRQ_HLEN MAXHOSTNAMELEN | # define INITRQ_HLEN MAXHOSTNAMELEN | |||
#else | #else | |||
# define INITRQ_HLEN 64 | # define INITRQ_HLEN 64 | |||
#endif | #endif | |||
/* | /* | |||
* This is what BSD 4.4 uses when talking to init. | * This is what BSD 4.4 uses when talking to init. | |||
* Linux doesn't use this right now. | * Linux doesn't use this right now. | |||
*/ | */ | |||
struct init_request_bsd { | struct init_request_bsd { | |||
char gen_id[8]; /* Beats me.. telnetd uses "fe" */ | char gen_id[8]; /* Beats me.. telnetd uses "fe" */ | |||
char tty_id[16]; /* Tty name minus /dev/tty */ | char tty_id[16]; /* Tty name minus /dev/tty */ | |||
char host[INITRQ_HLEN]; /* Hostname */ | char host[INITRQ_HLEN]; /* Hostname */ | |||
char term_type[16]; /* Terminal type */ | char term_type[16]; /* Terminal type */ | |||
int signal; /* Signal to send */ | int signal; /* Signal to send */ | |||
int pid; /* Process to send to */ | int pid; /* Process to send to */ | |||
char exec_name[128]; /* Program to execute */ | char exec_name[128]; /* Program to execute */ | |||
char reserved[128]; /* For future expansion. */ | char reserved[128]; /* For future expansion. */ | |||
}; | }; | |||
/* | /* | |||
* Because of legacy interfaces, "runlevel" and "sleeptime" | * Because of legacy interfaces, "runlevel" and "sleeptime" | |||
* aren't in a separate struct in the union. | * aren't in a separate struct in the union. | |||
* | * | |||
* The weird sizes are because init expects the whole | * The weird sizes are because init expects the whole | |||
* struct to be 384 bytes. | * struct to be 384 bytes. | |||
*/ | */ | |||
struct init_request { | struct init_request { | |||
int magic; /* Magic number */ | int magic; /* Magic number */ | |||
int cmd; /* What kind of request */ | int cmd; /* What kind of request */ | |||
int runlevel; /* Runlevel to change to */ | int runlevel; /* Runlevel to change to */ | |||
int sleeptime; /* Time between TERM and KILL */ | int sleeptime; /* Time between TERM and KILL */ | |||
union { | union { | |||
struct init_request_bsd bsd; | struct init_request_bsd bsd; | |||
char data[368]; | char data[368]; | |||
} i; | } i; | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
16 lines changed or deleted | 16 lines changed or added | |||
install.h | install.h | |||
---|---|---|---|---|
skipping to change at line 48 | skipping to change at line 48 | |||
UNIT_FILE_LINKED_RUNTIME, | UNIT_FILE_LINKED_RUNTIME, | |||
UNIT_FILE_MASKED, | UNIT_FILE_MASKED, | |||
UNIT_FILE_MASKED_RUNTIME, | UNIT_FILE_MASKED_RUNTIME, | |||
UNIT_FILE_STATIC, | UNIT_FILE_STATIC, | |||
UNIT_FILE_DISABLED, | UNIT_FILE_DISABLED, | |||
UNIT_FILE_INVALID, | UNIT_FILE_INVALID, | |||
_UNIT_FILE_STATE_MAX, | _UNIT_FILE_STATE_MAX, | |||
_UNIT_FILE_STATE_INVALID = -1 | _UNIT_FILE_STATE_INVALID = -1 | |||
} UnitFileState; | } UnitFileState; | |||
typedef enum UnitFilePresetMode { | ||||
UNIT_FILE_PRESET_FULL, | ||||
UNIT_FILE_PRESET_ENABLE_ONLY, | ||||
UNIT_FILE_PRESET_DISABLE_ONLY, | ||||
_UNIT_FILE_PRESET_MODE_MAX, | ||||
_UNIT_FILE_PRESET_INVALID = -1 | ||||
} UnitFilePresetMode; | ||||
typedef enum UnitFileChangeType { | typedef enum UnitFileChangeType { | |||
UNIT_FILE_SYMLINK, | UNIT_FILE_SYMLINK, | |||
UNIT_FILE_UNLINK, | UNIT_FILE_UNLINK, | |||
_UNIT_FILE_CHANGE_TYPE_MAX, | _UNIT_FILE_CHANGE_TYPE_MAX, | |||
_UNIT_FILE_CHANGE_TYPE_INVALID = -1 | _UNIT_FILE_CHANGE_TYPE_INVALID = -1 | |||
} UnitFileChangeType; | } UnitFileChangeType; | |||
typedef struct UnitFileChange { | typedef struct UnitFileChange { | |||
UnitFileChangeType type; | UnitFileChangeType type; | |||
char *path; | char *path; | |||
skipping to change at line 74 | skipping to change at line 82 | |||
} UnitFileList; | } UnitFileList; | |||
typedef struct { | typedef struct { | |||
char *name; | char *name; | |||
char *path; | char *path; | |||
char *user; | char *user; | |||
char **aliases; | char **aliases; | |||
char **wanted_by; | char **wanted_by; | |||
char **required_by; | char **required_by; | |||
char *default_instance; | ||||
} InstallInfo; | } InstallInfo; | |||
int unit_file_enable(UnitFileScope scope, bool runtime, const char *root_di | int unit_file_enable(UnitFileScope scope, bool runtime, const char *root_di | |||
r, char *files[], bool force, UnitFileChange **changes, unsigned *n_changes | r, char **files, bool force, UnitFileChange **changes, unsigned *n_changes) | |||
); | ; | |||
int unit_file_disable(UnitFileScope scope, bool runtime, const char *root_d | int unit_file_disable(UnitFileScope scope, bool runtime, const char *root_d | |||
ir, char *files[], UnitFileChange **changes, unsigned *n_changes); | ir, char **files, UnitFileChange **changes, unsigned *n_changes); | |||
int unit_file_reenable(UnitFileScope scope, bool runtime, const char *root_ | int unit_file_reenable(UnitFileScope scope, bool runtime, const char *root_ | |||
dir, char *files[], bool force, UnitFileChange **changes, unsigned *n_chang | dir, char **files, bool force, UnitFileChange **changes, unsigned *n_change | |||
es); | s); | |||
int unit_file_link(UnitFileScope scope, bool runtime, const char *root_dir, | int unit_file_link(UnitFileScope scope, bool runtime, const char *root_dir, | |||
char *files[], bool force, UnitFileChange **changes, unsigned *n_changes); | char **files, bool force, UnitFileChange **changes, unsigned *n_changes); | |||
int unit_file_preset(UnitFileScope scope, bool runtime, const char *root_di | int unit_file_preset(UnitFileScope scope, bool runtime, const char *root_di | |||
r, char *files[], bool force, UnitFileChange **changes, unsigned *n_changes | r, char **files, UnitFilePresetMode mode, bool force, UnitFileChange **chan | |||
); | ges, unsigned *n_changes); | |||
int unit_file_mask(UnitFileScope scope, bool runtime, const char *root_dir, | int unit_file_preset_all(UnitFileScope scope, bool runtime, const char *roo | |||
char *files[], bool force, UnitFileChange **changes, unsigned *n_changes); | t_dir, UnitFilePresetMode mode, bool force, UnitFileChange **changes, unsig | |||
int unit_file_unmask(UnitFileScope scope, bool runtime, const char *root_di | ned *n_changes); | |||
r, char *files[], UnitFileChange **changes, unsigned *n_changes); | int unit_file_mask(UnitFileScope scope, bool runtime, const char *root_dir, | |||
int unit_file_set_default(UnitFileScope scope, const char *root_dir, char * | char **files, bool force, UnitFileChange **changes, unsigned *n_changes); | |||
file, UnitFileChange **changes, unsigned *n_changes); | int unit_file_unmask(UnitFileScope scope, bool runtime, const char *root_di | |||
r, char **files, UnitFileChange **changes, unsigned *n_changes); | ||||
int unit_file_set_default(UnitFileScope scope, const char *root_dir, const | ||||
char *file, bool force, UnitFileChange **changes, unsigned *n_changes); | ||||
int unit_file_get_default(UnitFileScope scope, const char *root_dir, char * *name); | int unit_file_get_default(UnitFileScope scope, const char *root_dir, char * *name); | |||
UnitFileState unit_file_get_state(UnitFileScope scope, const char *root_dir , const char *filename); | UnitFileState unit_file_get_state(UnitFileScope scope, const char *root_dir , const char *filename); | |||
int unit_file_get_list(UnitFileScope scope, const char *root_dir, Hashmap * h); | int unit_file_get_list(UnitFileScope scope, const char *root_dir, Hashmap * h); | |||
void unit_file_list_free(Hashmap *h); | void unit_file_list_free(Hashmap *h); | |||
void unit_file_changes_free(UnitFileChange *changes, unsigned n_changes); | void unit_file_changes_free(UnitFileChange *changes, unsigned n_changes); | |||
int unit_file_query_preset(UnitFileScope scope, const char *name); | int unit_file_query_preset(UnitFileScope scope, const char *root_dir, const char *name); | |||
const char *unit_file_state_to_string(UnitFileState s) _const_; | const char *unit_file_state_to_string(UnitFileState s) _const_; | |||
UnitFileState unit_file_state_from_string(const char *s) _pure_; | UnitFileState unit_file_state_from_string(const char *s) _pure_; | |||
const char *unit_file_change_type_to_string(UnitFileChangeType s) _const_; | const char *unit_file_change_type_to_string(UnitFileChangeType s) _const_; | |||
UnitFileChangeType unit_file_change_type_from_string(const char *s) _pure_; | UnitFileChangeType unit_file_change_type_from_string(const char *s) _pure_; | |||
const char *unit_file_preset_mode_to_string(UnitFilePresetMode m) _const_; | ||||
UnitFilePresetMode unit_file_preset_mode_from_string(const char *s) _pure_; | ||||
End of changes. 5 change blocks. | ||||
20 lines changed or deleted | 33 lines changed or added | |||
ioprio.h | ioprio.h | |||
---|---|---|---|---|
skipping to change at line 47 | skipping to change at line 47 | |||
* 8 best effort priority levels are supported | * 8 best effort priority levels are supported | |||
*/ | */ | |||
#define IOPRIO_BE_NR (8) | #define IOPRIO_BE_NR (8) | |||
enum { | enum { | |||
IOPRIO_WHO_PROCESS = 1, | IOPRIO_WHO_PROCESS = 1, | |||
IOPRIO_WHO_PGRP, | IOPRIO_WHO_PGRP, | |||
IOPRIO_WHO_USER, | IOPRIO_WHO_USER, | |||
}; | }; | |||
static inline int ioprio_set(int which, int who, int ioprio) | static inline int ioprio_set(int which, int who, int ioprio) { | |||
{ | ||||
return syscall(__NR_ioprio_set, which, who, ioprio); | return syscall(__NR_ioprio_set, which, who, ioprio); | |||
} | } | |||
static inline int ioprio_get(int which, int who) | static inline int ioprio_get(int which, int who) { | |||
{ | ||||
return syscall(__NR_ioprio_get, which, who); | return syscall(__NR_ioprio_get, which, who); | |||
} | } | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 2 lines changed or added | |||
job.h | job.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 <errno.h> | #include <errno.h> | |||
typedef struct Job Job; | typedef struct Job Job; | |||
typedef struct JobDependency JobDependency; | typedef struct JobDependency JobDependency; | |||
typedef struct JobBusClient JobBusClient; | ||||
typedef enum JobType JobType; | typedef enum JobType JobType; | |||
typedef enum JobState JobState; | typedef enum JobState JobState; | |||
typedef enum JobMode JobMode; | typedef enum JobMode JobMode; | |||
typedef enum JobResult JobResult; | typedef enum JobResult JobResult; | |||
/* Be careful when changing the job types! Adjust job_merging_table[] accor dingly! */ | /* Be careful when changing the job types! Adjust job_merging_table[] accor dingly! */ | |||
enum JobType { | enum JobType { | |||
JOB_START, /* if a unit does not support being sta rted, we'll just wait until it becomes active */ | JOB_START, /* if a unit does not support being sta rted, we'll just wait until it becomes active */ | |||
JOB_VERIFY_ACTIVE, | JOB_VERIFY_ACTIVE, | |||
skipping to change at line 86 | skipping to change at line 85 | |||
enum JobState { | enum JobState { | |||
JOB_WAITING, | JOB_WAITING, | |||
JOB_RUNNING, | JOB_RUNNING, | |||
_JOB_STATE_MAX, | _JOB_STATE_MAX, | |||
_JOB_STATE_INVALID = -1 | _JOB_STATE_INVALID = -1 | |||
}; | }; | |||
enum JobMode { | enum JobMode { | |||
JOB_FAIL, /* Fail if a conflicting job is already qu eued */ | JOB_FAIL, /* Fail if a conflicting job is already qu eued */ | |||
JOB_REPLACE, /* Replace an existing conflicting job */ | JOB_REPLACE, /* Replace an existing conflicting job */ | |||
JOB_REPLACE_IRREVERSIBLY, /* Like JOB_REPLACE + produce irreversibl e jobs */ | JOB_REPLACE_IRREVERSIBLY,/* Like JOB_REPLACE + produce irreversible jobs */ | |||
JOB_ISOLATE, /* Start a unit, and stop all others */ | JOB_ISOLATE, /* Start a unit, and stop all others */ | |||
JOB_FLUSH, /* Flush out all other queued jobs when qu eing this one */ | ||||
JOB_IGNORE_DEPENDENCIES, /* Ignore both requirement and ordering de pendencies */ | JOB_IGNORE_DEPENDENCIES, /* Ignore both requirement and ordering de pendencies */ | |||
JOB_IGNORE_REQUIREMENTS, /* Ignore requirement dependencies */ | JOB_IGNORE_REQUIREMENTS, /* Ignore requirement dependencies */ | |||
_JOB_MODE_MAX, | _JOB_MODE_MAX, | |||
_JOB_MODE_INVALID = -1 | _JOB_MODE_INVALID = -1 | |||
}; | }; | |||
enum JobResult { | enum JobResult { | |||
JOB_DONE, /* Job completed successfully */ | JOB_DONE, /* Job completed successfully */ | |||
JOB_CANCELED, /* Job canceled by a conflicting job insta llation or by explicit cancel request */ | JOB_CANCELED, /* Job canceled by a conflicting job insta llation or by explicit cancel request */ | |||
JOB_TIMEOUT, /* JobTimeout elapsed */ | JOB_TIMEOUT, /* JobTimeout elapsed */ | |||
JOB_FAILED, /* Job failed */ | JOB_FAILED, /* Job failed */ | |||
JOB_DEPENDENCY, /* A required dependency job did not resul t in JOB_DONE */ | JOB_DEPENDENCY, /* A required dependency job did not resul t in JOB_DONE */ | |||
JOB_SKIPPED, /* JOB_RELOAD of inactive unit; negative r | JOB_SKIPPED, /* Negative result of JOB_VERIFY_ACTIVE */ | |||
esult of JOB_VERIFY_ACTIVE */ | JOB_INVALID, /* JOB_RELOAD of inactive unit */ | |||
_JOB_RESULT_MAX, | _JOB_RESULT_MAX, | |||
_JOB_RESULT_INVALID = -1 | _JOB_RESULT_INVALID = -1 | |||
}; | }; | |||
#include "sd-event.h" | ||||
#include "manager.h" | #include "manager.h" | |||
#include "unit.h" | #include "unit.h" | |||
#include "hashmap.h" | #include "hashmap.h" | |||
#include "list.h" | #include "list.h" | |||
struct JobDependency { | struct JobDependency { | |||
/* Encodes that the 'subject' job needs the 'object' job in | /* Encodes that the 'subject' job needs the 'object' job in | |||
* some way. This structure is used only while building a transacti on. */ | * some way. This structure is used only while building a transacti on. */ | |||
Job *subject; | Job *subject; | |||
Job *object; | Job *object; | |||
LIST_FIELDS(JobDependency, subject); | LIST_FIELDS(JobDependency, subject); | |||
LIST_FIELDS(JobDependency, object); | LIST_FIELDS(JobDependency, object); | |||
bool matters; | bool matters; | |||
bool conflicts; | bool conflicts; | |||
}; | }; | |||
struct JobBusClient { | ||||
LIST_FIELDS(JobBusClient, client); | ||||
/* Note that this bus object is not ref counted here. */ | ||||
DBusConnection *bus; | ||||
char name[0]; | ||||
}; | ||||
struct Job { | struct Job { | |||
Manager *manager; | Manager *manager; | |||
Unit *unit; | Unit *unit; | |||
LIST_FIELDS(Job, transaction); | LIST_FIELDS(Job, transaction); | |||
LIST_FIELDS(Job, run_queue); | LIST_FIELDS(Job, run_queue); | |||
LIST_FIELDS(Job, dbus_queue); | LIST_FIELDS(Job, dbus_queue); | |||
LIST_HEAD(JobDependency, subject_list); | LIST_HEAD(JobDependency, subject_list); | |||
LIST_HEAD(JobDependency, object_list); | LIST_HEAD(JobDependency, object_list); | |||
/* Used for graph algs as a "I have been here" marker */ | /* Used for graph algs as a "I have been here" marker */ | |||
Job* marker; | Job* marker; | |||
unsigned generation; | unsigned generation; | |||
uint32_t id; | uint32_t id; | |||
JobType type; | JobType type; | |||
JobState state; | JobState state; | |||
Watch timer_watch; | sd_event_source *timer_event_source; | |||
usec_t begin_usec; | ||||
/* There can be more than one client, because of job merging. */ | /* There can be more than one client, because of job merging. */ | |||
LIST_HEAD(JobBusClient, bus_client_list); | sd_bus_track *subscribed; | |||
char **deserialized_subscribed; | ||||
JobResult result; | JobResult result; | |||
bool installed:1; | bool installed:1; | |||
bool in_run_queue:1; | bool in_run_queue:1; | |||
bool matters_to_anchor:1; | bool matters_to_anchor:1; | |||
bool override:1; | bool override:1; | |||
bool in_dbus_queue:1; | bool in_dbus_queue:1; | |||
bool sent_dbus_new_signal:1; | bool sent_dbus_new_signal:1; | |||
bool ignore_order:1; | bool ignore_order:1; | |||
bool forgot_bus_clients:1; | ||||
bool irreversible:1; | bool irreversible:1; | |||
}; | }; | |||
JobBusClient* job_bus_client_new(DBusConnection *connection, const char *na | ||||
me); | ||||
Job* job_new(Unit *unit, JobType type); | Job* job_new(Unit *unit, JobType type); | |||
Job* job_new_raw(Unit *unit); | Job* job_new_raw(Unit *unit); | |||
void job_free(Job *job); | void job_free(Job *job); | |||
Job* job_install(Job *j); | Job* job_install(Job *j); | |||
int job_install_deserialized(Job *j); | int job_install_deserialized(Job *j); | |||
void job_uninstall(Job *j); | void job_uninstall(Job *j); | |||
void job_dump(Job *j, FILE*f, const char *prefix); | void job_dump(Job *j, FILE*f, const char *prefix); | |||
int job_serialize(Job *j, FILE *f, FDSet *fds); | int job_serialize(Job *j, FILE *f, FDSet *fds); | |||
int job_deserialize(Job *j, FILE *f, FDSet *fds); | int job_deserialize(Job *j, FILE *f, FDSet *fds); | |||
int job_coldplug(Job *j); | int job_coldplug(Job *j); | |||
skipping to change at line 209 | skipping to change at line 203 | |||
} | } | |||
bool job_type_is_redundant(JobType a, UnitActiveState b) _pure_; | bool job_type_is_redundant(JobType a, UnitActiveState b) _pure_; | |||
/* Collapses a state-dependent job type into a simpler type by observing | /* Collapses a state-dependent job type into a simpler type by observing | |||
* the state of the unit which it is going to be applied to. */ | * the state of the unit which it is going to be applied to. */ | |||
void job_type_collapse(JobType *t, Unit *u); | void job_type_collapse(JobType *t, Unit *u); | |||
int job_type_merge_and_collapse(JobType *a, JobType b, Unit *u); | int job_type_merge_and_collapse(JobType *a, JobType b, Unit *u); | |||
bool job_is_runnable(Job *j); | ||||
void job_add_to_run_queue(Job *j); | void job_add_to_run_queue(Job *j); | |||
void job_add_to_dbus_queue(Job *j); | void job_add_to_dbus_queue(Job *j); | |||
int job_start_timer(Job *j); | int job_start_timer(Job *j); | |||
void job_timer_event(Job *j, uint64_t n_elapsed, Watch *w); | ||||
int job_run_and_invalidate(Job *j); | int job_run_and_invalidate(Job *j); | |||
int job_finish_and_invalidate(Job *j, JobResult result, bool recursive); | int job_finish_and_invalidate(Job *j, JobResult result, bool recursive); | |||
char *job_dbus_path(Job *j); | char *job_dbus_path(Job *j); | |||
void job_shutdown_magic(Job *j); | void job_shutdown_magic(Job *j); | |||
const char* job_type_to_string(JobType t) _const_; | const char* job_type_to_string(JobType t) _const_; | |||
JobType job_type_from_string(const char *s) _pure_; | JobType job_type_from_string(const char *s) _pure_; | |||
const char* job_state_to_string(JobState t) _const_; | const char* job_state_to_string(JobState t) _const_; | |||
JobState job_state_from_string(const char *s) _pure_; | JobState job_state_from_string(const char *s) _pure_; | |||
const char* job_mode_to_string(JobMode t) _const_; | const char* job_mode_to_string(JobMode t) _const_; | |||
JobMode job_mode_from_string(const char *s) _pure_; | JobMode job_mode_from_string(const char *s) _pure_; | |||
const char* job_result_to_string(JobResult t) _const_; | const char* job_result_to_string(JobResult t) _const_; | |||
JobResult job_result_from_string(const char *s) _pure_; | JobResult job_result_from_string(const char *s) _pure_; | |||
int job_get_timeout(Job *j, uint64_t *timeout) _pure_; | ||||
End of changes. 13 change blocks. | ||||
20 lines changed or deleted | 9 lines changed or added | |||
journal-file.h | journal-file.h | |||
---|---|---|---|---|
skipping to change at line 40 | skipping to change at line 40 | |||
#include <systemd/sd-id128.h> | #include <systemd/sd-id128.h> | |||
#include "sparse-endian.h" | #include "sparse-endian.h" | |||
#include "journal-def.h" | #include "journal-def.h" | |||
#include "util.h" | #include "util.h" | |||
#include "mmap-cache.h" | #include "mmap-cache.h" | |||
#include "hashmap.h" | #include "hashmap.h" | |||
typedef struct JournalMetrics { | typedef struct JournalMetrics { | |||
uint64_t max_use; | uint64_t max_use; | |||
uint64_t use; | ||||
uint64_t max_size; | uint64_t max_size; | |||
uint64_t min_size; | uint64_t min_size; | |||
uint64_t keep_free; | uint64_t keep_free; | |||
} JournalMetrics; | } JournalMetrics; | |||
typedef enum direction { | typedef enum direction { | |||
DIRECTION_UP, | DIRECTION_UP, | |||
DIRECTION_DOWN | DIRECTION_DOWN | |||
} direction_t; | } direction_t; | |||
typedef struct JournalFile { | typedef struct JournalFile { | |||
int fd; | int fd; | |||
mode_t mode; | mode_t mode; | |||
int flags; | int flags; | |||
int prot; | int prot; | |||
bool writable; | bool writable:1; | |||
bool compress; | bool compress:1; | |||
bool seal; | bool seal:1; | |||
bool tail_entry_monotonic_valid; | bool tail_entry_monotonic_valid:1; | |||
direction_t last_direction; | direction_t last_direction; | |||
char *path; | char *path; | |||
struct stat last_stat; | struct stat last_stat; | |||
Header *header; | Header *header; | |||
HashItem *data_hash_table; | HashItem *data_hash_table; | |||
HashItem *field_hash_table; | HashItem *field_hash_table; | |||
skipping to change at line 114 | skipping to change at line 115 | |||
int flags, | int flags, | |||
mode_t mode, | mode_t mode, | |||
bool compress, | bool compress, | |||
bool seal, | bool seal, | |||
JournalMetrics *metrics, | JournalMetrics *metrics, | |||
MMapCache *mmap_cache, | MMapCache *mmap_cache, | |||
JournalFile *template, | JournalFile *template, | |||
JournalFile **ret); | JournalFile **ret); | |||
int journal_file_set_offline(JournalFile *f); | int journal_file_set_offline(JournalFile *f); | |||
int journal_file_set_online(JournalFile *f); | ||||
void journal_file_close(JournalFile *j); | void journal_file_close(JournalFile *j); | |||
int journal_file_open_reliably( | int journal_file_open_reliably( | |||
const char *fname, | const char *fname, | |||
int flags, | int flags, | |||
mode_t mode, | mode_t mode, | |||
bool compress, | bool compress, | |||
bool seal, | bool seal, | |||
JournalMetrics *metrics, | JournalMetrics *metrics, | |||
MMapCache *mmap_cache, | MMapCache *mmap_cache, | |||
JournalFile *template, | JournalFile *template, | |||
JournalFile **ret); | JournalFile **ret); | |||
#define ALIGN64(x) (((x) + 7ULL) & ~7ULL) | #define ALIGN64(x) (((x) + 7ULL) & ~7ULL) | |||
#define VALID64(x) (((x) & 7ULL) == 0ULL) | #define VALID64(x) (((x) & 7ULL) == 0ULL) | |||
/* Use six characters to cover the offsets common in smallish journal | ||||
* files without adding too many zeros. */ | ||||
#define OFSfmt "%06"PRIx64 | ||||
static inline bool VALID_REALTIME(uint64_t u) { | static inline bool VALID_REALTIME(uint64_t u) { | |||
/* This considers timestamps until the year 3112 valid. That should be plenty room... */ | /* This considers timestamps until the year 3112 valid. That should be plenty room... */ | |||
return u > 0 && u < (1ULL << 55); | return u > 0 && u < (1ULL << 55); | |||
} | } | |||
static inline bool VALID_MONOTONIC(uint64_t u) { | static inline bool VALID_MONOTONIC(uint64_t u) { | |||
/* This considers timestamps until 1142 years of runtime valid. */ | /* This considers timestamps until 1142 years of runtime valid. */ | |||
return u < (1ULL << 55); | return u < (1ULL << 55); | |||
} | } | |||
skipping to change at line 200 | skipping to change at line 204 | |||
int journal_file_rotate(JournalFile **f, bool compress, bool seal); | int journal_file_rotate(JournalFile **f, bool compress, bool seal); | |||
void journal_file_post_change(JournalFile *f); | void journal_file_post_change(JournalFile *f); | |||
void journal_default_metrics(JournalMetrics *m, int fd); | void journal_default_metrics(JournalMetrics *m, int fd); | |||
int journal_file_get_cutoff_realtime_usec(JournalFile *f, usec_t *from, use c_t *to); | int journal_file_get_cutoff_realtime_usec(JournalFile *f, usec_t *from, use c_t *to); | |||
int journal_file_get_cutoff_monotonic_usec(JournalFile *f, sd_id128_t boot, usec_t *from, usec_t *to); | int journal_file_get_cutoff_monotonic_usec(JournalFile *f, sd_id128_t boot, usec_t *from, usec_t *to); | |||
bool journal_file_rotate_suggested(JournalFile *f, usec_t max_file_usec); | bool journal_file_rotate_suggested(JournalFile *f, usec_t max_file_usec); | |||
static unsigned type_to_context(int type) { | ||||
/* One context for each type, plus one catch-all for the rest */ | ||||
return type > 0 && type < _OBJECT_TYPE_MAX ? type : 0; | ||||
} | ||||
static inline int journal_file_object_keep(JournalFile *f, Object *o, uint6 | ||||
4_t offset) { | ||||
unsigned context = type_to_context(o->object.type); | ||||
return mmap_cache_get(f->mmap, f->fd, f->prot, context, true, | ||||
offset, o->object.size, &f->last_stat, NULL); | ||||
} | ||||
static inline int journal_file_object_release(JournalFile *f, Object *o, ui | ||||
nt64_t offset) { | ||||
unsigned context = type_to_context(o->object.type); | ||||
return mmap_cache_release(f->mmap, f->fd, f->prot, context, | ||||
offset, o->object.size); | ||||
} | ||||
End of changes. 6 change blocks. | ||||
5 lines changed or deleted | 9 lines changed or added | |||
journal-internal.h | journal-internal.h | |||
---|---|---|---|---|
skipping to change at line 101 | skipping to change at line 101 | |||
}; | }; | |||
struct Directory { | struct Directory { | |||
char *path; | char *path; | |||
int wd; | int wd; | |||
bool is_root; | bool is_root; | |||
}; | }; | |||
struct sd_journal { | struct sd_journal { | |||
char *path; | char *path; | |||
char *prefix; | ||||
Hashmap *files; | Hashmap *files; | |||
MMapCache *mmap; | MMapCache *mmap; | |||
Location current_location; | Location current_location; | |||
JournalFile *current_file; | JournalFile *current_file; | |||
uint64_t current_field; | uint64_t current_field; | |||
Match *level0, *level1, *level2; | Match *level0, *level1, *level2; | |||
skipping to change at line 138 | skipping to change at line 139 | |||
Hashmap *directories_by_path; | Hashmap *directories_by_path; | |||
Hashmap *directories_by_wd; | Hashmap *directories_by_wd; | |||
Set *errors; | Set *errors; | |||
}; | }; | |||
char *journal_make_match_string(sd_journal *j); | char *journal_make_match_string(sd_journal *j); | |||
void journal_print_header(sd_journal *j); | void journal_print_header(sd_journal *j); | |||
static inline void journal_closep(sd_journal **j) { | DEFINE_TRIVIAL_CLEANUP_FUNC(sd_journal*, sd_journal_close); | |||
sd_journal_close(*j); | #define _cleanup_journal_close_ _cleanup_(sd_journal_closep) | |||
} | ||||
#define _cleanup_journal_close_ _cleanup_(journal_closep) | ||||
#define JOURNAL_FOREACH_DATA_RETVAL(j, data, l, retval) \ | #define JOURNAL_FOREACH_DATA_RETVAL(j, data, l, retval) \ | |||
for (sd_journal_restart_data(j); ((retval) = sd_journal_enumerate_d ata((j), &(data), &(l))) > 0; ) | for (sd_journal_restart_data(j); ((retval) = sd_journal_enumerate_d ata((j), &(data), &(l))) > 0; ) | |||
End of changes. 2 change blocks. | ||||
5 lines changed or deleted | 3 lines changed or added | |||
journal-vacuum.h | journal-vacuum.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
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/>. | |||
***/ | ***/ | |||
#include <inttypes.h> | #include <inttypes.h> | |||
int journal_directory_vacuum(const char *directory, uint64_t max_use, uint6 4_t min_free, usec_t max_retention_usec, usec_t *oldest_usec); | int journal_directory_vacuum(const char *directory, uint64_t max_use, usec_ t max_retention_usec, usec_t *oldest_usec); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
journald-kmsg.h | journald-kmsg.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
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/>. | |||
***/ | ***/ | |||
#include "journald-server.h" | #include "journald-server.h" | |||
int server_open_dev_kmsg(Server *s); | int server_open_dev_kmsg(Server *s); | |||
int server_read_dev_kmsg(Server *s); | ||||
int server_flush_dev_kmsg(Server *s); | int server_flush_dev_kmsg(Server *s); | |||
void server_forward_kmsg(Server *s, int priority, const char *identifier, c onst char *message, struct ucred *ucred); | void server_forward_kmsg(Server *s, int priority, const char *identifier, c onst char *message, struct ucred *ucred); | |||
int server_open_kernel_seqnum(Server *s); | int server_open_kernel_seqnum(Server *s); | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 0 lines changed or added | |||
journald-native.h | journald-native.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
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/>. | |||
***/ | ***/ | |||
#include "journald-server.h" | #include "journald-server.h" | |||
/* Make sure not to make this smaller than the maximum coredump | ||||
* size. See COREDUMP_MAX in coredump.c */ | ||||
#define ENTRY_SIZE_MAX (1024*1024*768) | ||||
#define DATA_SIZE_MAX (1024*1024*768) | ||||
bool valid_user_field(const char *p, size_t l, bool allow_protected); | ||||
void server_process_native_message(Server *s, const void *buffer, size_t bu ffer_size, struct ucred *ucred, struct timeval *tv, const char *label, size _t label_len); | void server_process_native_message(Server *s, const void *buffer, size_t bu ffer_size, struct ucred *ucred, struct timeval *tv, const char *label, size _t label_len); | |||
void server_process_native_file(Server *s, int fd, struct ucred *ucred, str uct timeval *tv, const char *label, size_t label_len); | void server_process_native_file(Server *s, int fd, struct ucred *ucred, str uct timeval *tv, const char *label, size_t label_len); | |||
int server_open_native_socket(Server*s); | int server_open_native_socket(Server*s); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 7 lines changed or added | |||
journald-server.h | journald-server.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 <stdbool.h> | #include <stdbool.h> | |||
#include <sys/epoll.h> | #include <sys/epoll.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <sys/socket.h> | #include <sys/socket.h> | |||
#include "sd-event.h" | ||||
#include "journal-file.h" | #include "journal-file.h" | |||
#include "hashmap.h" | #include "hashmap.h" | |||
#include "util.h" | #include "util.h" | |||
#include "audit.h" | #include "audit.h" | |||
#include "journald-rate-limit.h" | #include "journald-rate-limit.h" | |||
#include "list.h" | #include "list.h" | |||
typedef enum Storage { | typedef enum Storage { | |||
STORAGE_AUTO, | STORAGE_AUTO, | |||
STORAGE_VOLATILE, | STORAGE_VOLATILE, | |||
STORAGE_PERSISTENT, | STORAGE_PERSISTENT, | |||
STORAGE_NONE, | STORAGE_NONE, | |||
_STORAGE_MAX, | _STORAGE_MAX, | |||
_STORAGE_INVALID = -1 | _STORAGE_INVALID = -1 | |||
} Storage; | } Storage; | |||
typedef enum SplitMode { | typedef enum SplitMode { | |||
SPLIT_LOGIN, | ||||
SPLIT_UID, | SPLIT_UID, | |||
SPLIT_LOGIN, | ||||
SPLIT_NONE, | SPLIT_NONE, | |||
_SPLIT_MAX, | _SPLIT_MAX, | |||
_SPLIT_INVALID = -1 | _SPLIT_INVALID = -1 | |||
} SplitMode; | } SplitMode; | |||
typedef struct StdoutStream StdoutStream; | typedef struct StdoutStream StdoutStream; | |||
typedef struct Server { | typedef struct Server { | |||
int epoll_fd; | ||||
int signal_fd; | ||||
int syslog_fd; | int syslog_fd; | |||
int native_fd; | int native_fd; | |||
int stdout_fd; | int stdout_fd; | |||
int dev_kmsg_fd; | int dev_kmsg_fd; | |||
int hostname_fd; | ||||
sd_event *event; | ||||
sd_event_source *syslog_event_source; | ||||
sd_event_source *native_event_source; | ||||
sd_event_source *stdout_event_source; | ||||
sd_event_source *dev_kmsg_event_source; | ||||
sd_event_source *sync_event_source; | ||||
sd_event_source *sigusr1_event_source; | ||||
sd_event_source *sigusr2_event_source; | ||||
sd_event_source *sigterm_event_source; | ||||
sd_event_source *sigint_event_source; | ||||
sd_event_source *hostname_event_source; | ||||
JournalFile *runtime_journal; | JournalFile *runtime_journal; | |||
JournalFile *system_journal; | JournalFile *system_journal; | |||
Hashmap *user_journals; | Hashmap *user_journals; | |||
uint64_t seqnum; | uint64_t seqnum; | |||
char *buffer; | char *buffer; | |||
size_t buffer_size; | size_t buffer_size; | |||
skipping to change at line 87 | skipping to change at line 100 | |||
JournalMetrics runtime_metrics; | JournalMetrics runtime_metrics; | |||
JournalMetrics system_metrics; | JournalMetrics system_metrics; | |||
bool compress; | bool compress; | |||
bool seal; | bool seal; | |||
bool forward_to_kmsg; | bool forward_to_kmsg; | |||
bool forward_to_syslog; | bool forward_to_syslog; | |||
bool forward_to_console; | bool forward_to_console; | |||
bool forward_to_wall; | ||||
unsigned n_forward_syslog_missed; | unsigned n_forward_syslog_missed; | |||
usec_t last_warn_forward_syslog_missed; | usec_t last_warn_forward_syslog_missed; | |||
uint64_t cached_available_space; | uint64_t cached_available_space; | |||
usec_t cached_available_space_timestamp; | usec_t cached_available_space_timestamp; | |||
uint64_t var_available_timestamp; | uint64_t var_available_timestamp; | |||
usec_t max_retention_usec; | usec_t max_retention_usec; | |||
skipping to change at line 109 | skipping to change at line 123 | |||
LIST_HEAD(StdoutStream, stdout_streams); | LIST_HEAD(StdoutStream, stdout_streams); | |||
unsigned n_stdout_streams; | unsigned n_stdout_streams; | |||
char *tty_path; | char *tty_path; | |||
int max_level_store; | int max_level_store; | |||
int max_level_syslog; | int max_level_syslog; | |||
int max_level_kmsg; | int max_level_kmsg; | |||
int max_level_console; | int max_level_console; | |||
int max_level_wall; | ||||
Storage storage; | Storage storage; | |||
SplitMode split_mode; | SplitMode split_mode; | |||
MMapCache *mmap; | MMapCache *mmap; | |||
bool dev_kmsg_readable; | bool dev_kmsg_readable; | |||
uint64_t *kernel_seqnum; | uint64_t *kernel_seqnum; | |||
struct udev *udev; | struct udev *udev; | |||
int sync_timer_fd; | ||||
bool sync_scheduled; | bool sync_scheduled; | |||
char machine_id_field[sizeof("_MACHINE_ID=") + 32]; | ||||
char boot_id_field[sizeof("_BOOT_ID=") + 32]; | ||||
char *hostname_field; | ||||
/* Cached cgroup root, so that we don't have to query that all the | ||||
time */ | ||||
char *cgroup_root; | ||||
} Server; | } Server; | |||
#define N_IOVEC_META_FIELDS 20 | #define N_IOVEC_META_FIELDS 20 | |||
#define N_IOVEC_KERNEL_FIELDS 64 | #define N_IOVEC_KERNEL_FIELDS 64 | |||
#define N_IOVEC_UDEV_FIELDS 32 | #define N_IOVEC_UDEV_FIELDS 32 | |||
#define N_IOVEC_OBJECT_FIELDS 11 | #define N_IOVEC_OBJECT_FIELDS 11 | |||
void server_dispatch_message(Server *s, struct iovec *iovec, unsigned n, un signed m, struct ucred *ucred, struct timeval *tv, const char *label, size_ t label_len, const char *unit_id, int priority, pid_t object_pid); | void server_dispatch_message(Server *s, struct iovec *iovec, unsigned n, un signed m, struct ucred *ucred, struct timeval *tv, const char *label, size_ t label_len, const char *unit_id, int priority, pid_t object_pid); | |||
void server_driver_message(Server *s, sd_id128_t message_id, const char *fo rmat, ...) _printf_attr_(3,4); | void server_driver_message(Server *s, sd_id128_t message_id, const char *fo rmat, ...) _printf_(3,4); | |||
/* gperf lookup function */ | /* gperf lookup function */ | |||
const struct ConfigPerfItem* journald_gperf_lookup(const char *key, unsigne d length); | const struct ConfigPerfItem* journald_gperf_lookup(const char *key, unsigne d length); | |||
int config_parse_storage(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_storage(const char *unit, const char *filename, unsigned l ine, const char *section, unsigned section_line, const char *lvalue, int lt ype, const char *rvalue, void *data, void *userdata); | |||
const char *storage_to_string(Storage s) _const_; | const char *storage_to_string(Storage s) _const_; | |||
Storage storage_from_string(const char *s) _pure_; | Storage storage_from_string(const char *s) _pure_; | |||
int config_parse_split_mode(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_split_mode(const char *unit, const char *filename, unsigne d line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
const char *split_mode_to_string(SplitMode s) _const_; | const char *split_mode_to_string(SplitMode s) _const_; | |||
SplitMode split_mode_from_string(const char *s) _pure_; | SplitMode split_mode_from_string(const char *s) _pure_; | |||
void server_fix_perms(Server *s, JournalFile *f, uid_t uid); | void server_fix_perms(Server *s, JournalFile *f, uid_t uid); | |||
bool shall_try_append_again(JournalFile *f, int r); | bool shall_try_append_again(JournalFile *f, int r); | |||
int server_init(Server *s); | int server_init(Server *s); | |||
void server_done(Server *s); | void server_done(Server *s); | |||
void server_sync(Server *s); | void server_sync(Server *s); | |||
void server_vacuum(Server *s); | void server_vacuum(Server *s); | |||
void server_rotate(Server *s); | void server_rotate(Server *s); | |||
int server_schedule_sync(Server *s, int priority); | int server_schedule_sync(Server *s, int priority); | |||
int server_flush_to_var(Server *s); | int server_flush_to_var(Server *s); | |||
int process_event(Server *s, struct epoll_event *ev); | ||||
void server_maybe_append_tags(Server *s); | void server_maybe_append_tags(Server *s); | |||
int process_datagram(sd_event_source *es, int fd, uint32_t revents, void *u serdata); | ||||
End of changes. 14 change blocks. | ||||
8 lines changed or deleted | 29 lines changed or added | |||
journald-stream.h | journald-stream.h | |||
---|---|---|---|---|
skipping to change at line 28 | skipping to change at line 28 | |||
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/>. | |||
***/ | ***/ | |||
#include "journald-server.h" | #include "journald-server.h" | |||
int server_open_stdout_socket(Server *s); | int server_open_stdout_socket(Server *s); | |||
int stdout_stream_new(Server *s); | ||||
void stdout_stream_free(StdoutStream *s); | void stdout_stream_free(StdoutStream *s); | |||
int stdout_stream_process(StdoutStream *s); | ||||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 0 lines changed or added | |||
journald-syslog.h | journald-syslog.h | |||
---|---|---|---|---|
skipping to change at line 28 | skipping to change at line 28 | |||
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/>. | |||
***/ | ***/ | |||
#include "journald-server.h" | #include "journald-server.h" | |||
int syslog_fixup_facility(int priority) _const_; | int syslog_fixup_facility(int priority) _const_; | |||
void syslog_parse_priority(char **p, int *priority, bool with_facility); | void syslog_parse_priority(const char **p, int *priority, bool with_facilit y); | |||
size_t syslog_parse_identifier(const char **buf, char **identifier, char ** pid); | size_t syslog_parse_identifier(const char **buf, char **identifier, char ** pid); | |||
void server_forward_syslog(Server *s, int priority, const char *identifier, const char *message, struct ucred *ucred, struct timeval *tv); | void server_forward_syslog(Server *s, int priority, const char *identifier, const char *message, struct ucred *ucred, struct timeval *tv); | |||
void server_process_syslog_message(Server *s, const char *buf, struct ucred *ucred, struct timeval *tv, const char *label, size_t label_len); | void server_process_syslog_message(Server *s, const char *buf, struct ucred *ucred, struct timeval *tv, const char *label, size_t label_len); | |||
int server_open_syslog_socket(Server *s); | int server_open_syslog_socket(Server *s); | |||
void server_maybe_warn_forward_syslog_missed(Server *s); | void server_maybe_warn_forward_syslog_missed(Server *s); | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
kdbus.h | kdbus.h | |||
---|---|---|---|---|
skipping to change at line 12 | skipping to change at line 12 | |||
* Copyright (C) 2013 Kay Sievers | * Copyright (C) 2013 Kay Sievers | |||
* Copyright (C) 2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org> | * Copyright (C) 2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |||
* Copyright (C) 2013 Linux Foundation | * Copyright (C) 2013 Linux Foundation | |||
* Copyright (C) 2013 Lennart Poettering | * Copyright (C) 2013 Lennart Poettering | |||
* Copyright (C) 2013 Daniel Mack <daniel@zonque.org> | * Copyright (C) 2013 Daniel Mack <daniel@zonque.org> | |||
* | * | |||
* kdbus is free software; you can redistribute it and/or modify it under | * kdbus is free software; you can redistribute it and/or modify it under | |||
* the terms of the GNU Lesser General Public License as published by the | * the terms of the GNU Lesser General Public License as published by the | |||
* Free Software Foundation; either version 2.1 of the License, or (at | * Free Software Foundation; either version 2.1 of the License, or (at | |||
* your option) any later version. | * your option) any later version. | |||
* | ||||
* "Everything should be made as simple as possible, but not simpler." | ||||
* -- Albert Einstein | ||||
*/ | */ | |||
#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_IOCTL_MAGIC 0x95 | |||
#define KDBUS_SRC_ID_KERNEL (0) | #define KDBUS_SRC_ID_KERNEL (0) | |||
#define KDBUS_DST_ID_WELL_KNOWN_NAME (0) | #define KDBUS_DST_ID_NAME (0) | |||
#define KDBUS_MATCH_SRC_ID_ANY (~0ULL) | #define KDBUS_MATCH_ID_ANY (~0ULL) | |||
#define KDBUS_DST_ID_BROADCAST (~0ULL) | #define KDBUS_DST_ID_BROADCAST (~0ULL) | |||
/* Common first elements in a structure which are used to iterate over | /** | |||
* a list of elements. */ | * struct kdbus_notify_id_change - name registry change message | |||
#define KDBUS_PART_HEADER \ | * @id: New or former owner of the name | |||
struct { \ | * @flags: flags field from KDBUS_HELLO_* | |||
__u64 size; \ | * | |||
__u64 type; \ | * Sent from kernel to userspace when the owner or activator of | |||
} | * a well-known name changes. | |||
* | ||||
/* Message sent from kernel to userspace, when the owner or starter of | * Attached to: | |||
* a well-known name changes */ | * KDBUS_ITEM_ID_ADD | |||
struct kdbus_manager_msg_name_change { | * KDBUS_ITEM_ID_REMOVE | |||
__u64 old_id; | */ | |||
__u64 new_id; | struct kdbus_notify_id_change { | |||
__u64 flags; /* 0 or (possibly?) KDBUS_NAME_IN_QU | __u64 id; | |||
EUE */ | __u64 flags; | |||
char name[0]; | ||||
}; | }; | |||
struct kdbus_manager_msg_id_change { | /** | |||
__u64 id; | * struct kdbus_notify_name_change - name registry change message | |||
__u64 flags; /* The kernel flags field from KDBUS | * @old: ID and flags of former owner of a name | |||
_HELLO */ | * @new: ID and flags of new owner of a name | |||
* @name: Well-known name | ||||
* | ||||
* Sent from kernel to userspace when the owner or activator of | ||||
* a well-known name changes. | ||||
* | ||||
* Attached to: | ||||
* KDBUS_ITEM_NAME_ADD | ||||
* KDBUS_ITEM_NAME_REMOVE | ||||
* KDBUS_ITEM_NAME_CHANGE | ||||
*/ | ||||
struct kdbus_notify_name_change { | ||||
struct kdbus_notify_id_change old; | ||||
struct kdbus_notify_id_change new; | ||||
char name[0]; | ||||
}; | }; | |||
/** | ||||
* struct kdbus_creds - process credentials | ||||
* @uid: User ID | ||||
* @gid: Group ID | ||||
* @pid: Process ID | ||||
* @tid: Thread ID | ||||
* @starttime: Starttime of the process | ||||
* | ||||
* The starttime of the process PID. This is useful to detect PID overruns | ||||
* from the client side. i.e. if you use the PID to look something up in | ||||
* /proc/$PID/ you can afterwards check the starttime field of it, to ensur | ||||
e | ||||
* you didn't run into a PID overrun. | ||||
* | ||||
* Attached to: | ||||
* KDBUS_ITEM_CREDS | ||||
*/ | ||||
struct kdbus_creds { | struct kdbus_creds { | |||
__u64 uid; | __u64 uid; | |||
__u64 gid; | __u64 gid; | |||
__u64 pid; | __u64 pid; | |||
__u64 tid; | __u64 tid; | |||
/* The starttime of the process PID. This is useful to detect | ||||
PID overruns from the client side. i.e. if you use the PID to | ||||
look something up in /proc/$PID/ you can afterwards check the | ||||
starttime field of it to ensure you didn't run into a PID | ||||
ovretun. */ | ||||
__u64 starttime; | __u64 starttime; | |||
}; | }; | |||
/** | ||||
* struct kdbus_audit - audit information | ||||
* @sessionid: The audit session ID | ||||
* @loginuid: The audit login uid | ||||
* | ||||
* Attached to: | ||||
* KDBUS_ITEM_AUDIT | ||||
*/ | ||||
struct kdbus_audit { | struct kdbus_audit { | |||
__u64 sessionid; | __u64 sessionid; | |||
__u64 loginuid; | __u64 loginuid; | |||
}; | }; | |||
/** | ||||
* struct kdbus_timestamp | ||||
* @seqnum: Global per-domain message sequence number | ||||
* @monotonic_ns: Monotonic timestamp, in nanoseconds | ||||
* @realtime_ns: Realtime timestamp, in nanoseconds | ||||
* | ||||
* Attached to: | ||||
* KDBUS_ITEM_TIMESTAMP | ||||
*/ | ||||
struct kdbus_timestamp { | struct kdbus_timestamp { | |||
__u64 seqnum; | ||||
__u64 monotonic_ns; | __u64 monotonic_ns; | |||
__u64 realtime_ns; | __u64 realtime_ns; | |||
}; | }; | |||
/** | ||||
* struct kdbus_vec - I/O vector for kdbus payload items | ||||
* @size: The size of the vector | ||||
* @address: Memory address for memory addresses | ||||
* @offset: Offset in the in-message payload memory, | ||||
* relative to the message head | ||||
* | ||||
* Attached to: | ||||
* KDBUS_ITEM_PAYLOAD_VEC | ||||
*/ | ||||
struct kdbus_vec { | struct kdbus_vec { | |||
__u64 size; | __u64 size; | |||
union { | union { | |||
__u64 address; | __u64 address; | |||
__u64 offset; | __u64 offset; | |||
}; | }; | |||
}; | }; | |||
/** | ||||
* struct kdbus_bloom_parameter - bus-wide bloom parameters | ||||
* @size: Size of the bit field in bytes (m / 8) | ||||
* @n_hash: Number of hash functions used (k) | ||||
*/ | ||||
struct kdbus_bloom_parameter { | ||||
__u64 size; | ||||
__u64 n_hash; | ||||
}; | ||||
/** | ||||
* struct kdbus_bloom_filter - bloom filter containing n elements | ||||
* @generation: Generation of the element set in the filter | ||||
* @data: Bit field, multiple of 8 bytes | ||||
*/ | ||||
struct kdbus_bloom_filter { | ||||
__u64 generation; | ||||
__u64 data[0]; | ||||
}; | ||||
/** | ||||
* struct kdbus_memfd - a kdbus memfd | ||||
* @size: The memfd's size | ||||
* @fd: The file descriptor number | ||||
* @__pad: Padding to ensure proper alignement and size | ||||
* | ||||
* Attached to: | ||||
* KDBUS_ITEM_PAYLOAD_MEMFD | ||||
*/ | ||||
struct kdbus_memfd { | struct kdbus_memfd { | |||
__u64 size; | __u64 size; | |||
int fd; | int fd; | |||
__u32 __pad; | __u32 __pad; | |||
}; | }; | |||
/* Message Item Types */ | /** | |||
enum { | * struct kdbus_name - a registered well-known name with its flags | |||
_KDBUS_MSG_NULL, | * @flags: Flags from KDBUS_NAME_* | |||
* @name: Well-known name | ||||
/* Filled in by userspace */ | * | |||
KDBUS_MSG_PAYLOAD_VEC, /* .data_vec, reference to memory ar | * Attached to: | |||
ea */ | * KDBUS_ITEM_NAME | |||
KDBUS_MSG_PAYLOAD_OFF, /* .data_vec, reference to memory ar | */ | |||
ea */ | struct kdbus_name { | |||
KDBUS_MSG_PAYLOAD_MEMFD, /* file descriptor of a special data | __u64 flags; | |||
file */ | char name[0]; | |||
KDBUS_MSG_FDS, /* .data_fds of file descriptors */ | }; | |||
KDBUS_MSG_BLOOM, /* for broadcasts, carries bloom fil | ||||
ter blob in .data */ | /** | |||
KDBUS_MSG_DST_NAME, /* destination's well-known name, in | * struct kdbus_policy_access - policy access item | |||
.str */ | * @type: One of KDBUS_POLICY_ACCESS_* types | |||
KDBUS_MSG_PRIORITY, /* queue priority for message */ | * @access: Access to grant | |||
* @id: For KDBUS_POLICY_ACCESS_USER, the uid | ||||
/* Filled in by kernelspace */ | * For KDBUS_POLICY_ACCESS_GROUP, the gid | |||
KDBUS_MSG_SRC_NAMES = 0x400,/* NUL separated string list with we | */ | |||
ll-known names of source */ | struct kdbus_policy_access { | |||
KDBUS_MSG_TIMESTAMP, /* .timestamp */ | __u64 type; /* USER, GROUP, WORLD */ | |||
KDBUS_MSG_SRC_CREDS, /* .creds */ | __u64 access; /* OWN, TALK, SEE */ | |||
KDBUS_MSG_SRC_PID_COMM, /* optional, in .str */ | __u64 id; /* uid, gid, 0 */ | |||
KDBUS_MSG_SRC_TID_COMM, /* 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_CGROUP, /* optional, in .str */ | ||||
KDBUS_MSG_SRC_CAPS, /* caps data blob, in .data */ | ||||
KDBUS_MSG_SRC_SECLABEL, /* NUL terminated string, in .str */ | ||||
KDBUS_MSG_SRC_AUDIT, /* .audit */ | ||||
/* Special messages from kernel, consisting of one and only one of t | ||||
hese data blocks */ | ||||
KDBUS_MSG_NAME_ADD = 0x800,/* .name_change */ | ||||
KDBUS_MSG_NAME_REMOVE, /* .name_change */ | ||||
KDBUS_MSG_NAME_CHANGE, /* .name_change */ | ||||
KDBUS_MSG_ID_ADD, /* .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_DEAD, /* dito */ | ||||
}; | }; | |||
/** | /** | |||
* struct kdbus_item - chain of data blocks | * enum kdbus_item_type - item types to chain data in a list | |||
* | * @_KDBUS_ITEM_NULL: Uninitialized/invalid | |||
* size: overall data record size | * @_KDBUS_ITEM_USER_BASE: Start of user items | |||
* type: kdbus_item type of data | * @KDBUS_ITEM_PAYLOAD_VEC: Vector to data | |||
* @KDBUS_ITEM_PAYLOAD_OFF: Data at returned offset to message head | ||||
* @KDBUS_ITEM_PAYLOAD_MEMFD: Data as sealed memfd | ||||
* @KDBUS_ITEM_FDS: Attached file descriptors | ||||
* @KDBUS_ITEM_BLOOM_PARAMETER: Bus-wide bloom parameters, used with | ||||
* KDBUS_CMD_BUS_MAKE, carries a | ||||
* struct kdbus_bloom_parameter | ||||
* @KDBUS_ITEM_BLOOM_FILTER: Bloom filter carried with a message, used to | ||||
* match against a bloom mask of a connection, | ||||
* carries a struct kdbus_bloom_filter | ||||
* @KDBUS_ITEM_BLOOM_MASK: Bloom mask used to match against a message's | ||||
* bloom filter | ||||
* @KDBUS_ITEM_DST_NAME: Destination's well-known name | ||||
* @KDBUS_ITEM_MAKE_NAME: Name of domain, bus, endpoint | ||||
* @KDBUS_ITEM_MEMFD_NAME: The human readable name of a memfd (debuggin | ||||
g) | ||||
* @KDBUS_ITEM_ATTACH_FLAGS: Attach-flags, used for updating which metada | ||||
ta | ||||
* a connection subscribes to | ||||
* @_KDBUS_ITEM_ATTACH_BASE: Start of metadata attach items | ||||
* @KDBUS_ITEM_NAME: Well-know name with flags | ||||
* @KDBUS_ITEM_ID: Connection ID | ||||
* @KDBUS_ITEM_TIMESTAMP: Timestamp | ||||
* @KDBUS_ITEM_CREDS: Process credential | ||||
* @KDBUS_ITEM_PID_COMM: Process ID "comm" identifier | ||||
* @KDBUS_ITEM_TID_COMM: Thread ID "comm" identifier | ||||
* @KDBUS_ITEM_EXE: The path of the executable | ||||
* @KDBUS_ITEM_CMDLINE: The process command line | ||||
* @KDBUS_ITEM_CGROUP: The croup membership | ||||
* @KDBUS_ITEM_CAPS: The process capabilities | ||||
* @KDBUS_ITEM_SECLABEL: The security label | ||||
* @KDBUS_ITEM_AUDIT: The audit IDs | ||||
* @KDBUS_ITEM_CONN_NAME: The connection's human-readable name (debugg | ||||
ing) | ||||
* @_KDBUS_ITEM_POLICY_BASE: Start of policy items | ||||
* @KDBUS_ITEM_POLICY_ACCESS: Policy access block | ||||
* @_KDBUS_ITEM_KERNEL_BASE: Start of kernel-generated message items | ||||
* @KDBUS_ITEM_NAME_ADD: Notify in struct kdbus_notify_name_change | ||||
* @KDBUS_ITEM_NAME_REMOVE: Notify in struct kdbus_notify_name_change | ||||
* @KDBUS_ITEM_NAME_CHANGE: Notify in struct kdbus_notify_name_change | ||||
* @KDBUS_ITEM_ID_ADD: Notify in struct kdbus_notify_id_change | ||||
* @KDBUS_ITEM_ID_REMOVE: Notify in struct kdbus_notify_id_change | ||||
* @KDBUS_ITEM_REPLY_TIMEOUT: Timeout has been reached | ||||
* @KDBUS_ITEM_REPLY_DEAD: Destination died | ||||
*/ | ||||
enum kdbus_item_type { | ||||
_KDBUS_ITEM_NULL, | ||||
_KDBUS_ITEM_USER_BASE, | ||||
KDBUS_ITEM_PAYLOAD_VEC = _KDBUS_ITEM_USER_BASE, | ||||
KDBUS_ITEM_PAYLOAD_OFF, | ||||
KDBUS_ITEM_PAYLOAD_MEMFD, | ||||
KDBUS_ITEM_FDS, | ||||
KDBUS_ITEM_BLOOM_PARAMETER, | ||||
KDBUS_ITEM_BLOOM_FILTER, | ||||
KDBUS_ITEM_BLOOM_MASK, | ||||
KDBUS_ITEM_DST_NAME, | ||||
KDBUS_ITEM_MAKE_NAME, | ||||
KDBUS_ITEM_MEMFD_NAME, | ||||
KDBUS_ITEM_ATTACH_FLAGS, | ||||
_KDBUS_ITEM_ATTACH_BASE = 0x1000, | ||||
KDBUS_ITEM_NAME = _KDBUS_ITEM_ATTACH_BASE, | ||||
KDBUS_ITEM_ID, | ||||
KDBUS_ITEM_TIMESTAMP, | ||||
KDBUS_ITEM_CREDS, | ||||
KDBUS_ITEM_PID_COMM, | ||||
KDBUS_ITEM_TID_COMM, | ||||
KDBUS_ITEM_EXE, | ||||
KDBUS_ITEM_CMDLINE, | ||||
KDBUS_ITEM_CGROUP, | ||||
KDBUS_ITEM_CAPS, | ||||
KDBUS_ITEM_SECLABEL, | ||||
KDBUS_ITEM_AUDIT, | ||||
KDBUS_ITEM_CONN_NAME, | ||||
_KDBUS_ITEM_POLICY_BASE = 0x2000, | ||||
KDBUS_ITEM_POLICY_ACCESS = _KDBUS_ITEM_POLICY_BASE, | ||||
_KDBUS_ITEM_KERNEL_BASE = 0x8000, | ||||
KDBUS_ITEM_NAME_ADD = _KDBUS_ITEM_KERNEL_BASE, | ||||
KDBUS_ITEM_NAME_REMOVE, | ||||
KDBUS_ITEM_NAME_CHANGE, | ||||
KDBUS_ITEM_ID_ADD, | ||||
KDBUS_ITEM_ID_REMOVE, | ||||
KDBUS_ITEM_REPLY_TIMEOUT, | ||||
KDBUS_ITEM_REPLY_DEAD, | ||||
}; | ||||
/** | ||||
* struct kdbus_item - chain of data blocks | ||||
* @size: Overall data record size | ||||
* @type: Kdbus_item type of data | ||||
* @data: Generic bytes | ||||
* @data32: Generic 32 bit array | ||||
* @data64: Generic 64 bit array | ||||
* @str: Generic string | ||||
* @id: Connection ID | ||||
* @vec: KDBUS_ITEM_PAYLOAD_VEC | ||||
* @creds: KDBUS_ITEM_CREDS | ||||
* @audit: KDBUS_ITEM_AUDIT | ||||
* @timestamp: KDBUS_ITEM_TIMESTAMP | ||||
* @name: KDBUS_ITEM_NAME | ||||
* @bloom_parameter: KDBUS_ITEM_BLOOM_PARAMETER | ||||
* @bloom_filter: KDBUS_ITEM_BLOOM_FILTER | ||||
* @memfd: KDBUS_ITEM_PAYLOAD_MEMFD | ||||
* @name_change: KDBUS_ITEM_NAME_ADD | ||||
* KDBUS_ITEM_NAME_REMOVE | ||||
* KDBUS_ITEM_NAME_CHANGE | ||||
* @id_change: KDBUS_ITEM_ID_ADD | ||||
* KDBUS_ITEM_ID_REMOVE | ||||
* @policy: KDBUS_ITEM_POLICY_ACCESS | ||||
*/ | */ | |||
struct kdbus_item { | struct kdbus_item { | |||
KDBUS_PART_HEADER; | __u64 size; | |||
__u64 type; | ||||
union { | union { | |||
/* 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 */ | ||||
__u64 id; | __u64 id; | |||
/* data vector */ | ||||
struct kdbus_vec vec; | struct kdbus_vec vec; | |||
/* 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; | |||
struct kdbus_name name; | ||||
/* specific fields */ | struct kdbus_bloom_parameter bloom_parameter; | |||
struct kdbus_bloom_filter bloom_filter; | ||||
struct kdbus_memfd memfd; | struct kdbus_memfd memfd; | |||
int fds[0]; | int fds[0]; | |||
struct kdbus_manager_msg_name_change name_change; | struct kdbus_notify_name_change name_change; | |||
struct kdbus_manager_msg_id_change id_change; | struct kdbus_notify_id_change id_change; | |||
struct kdbus_policy_access policy_access; | ||||
}; | }; | |||
}; | }; | |||
enum { | /** | |||
* enum kdbus_msg_flags - type of message | ||||
* @KDBUS_MSG_FLAGS_EXPECT_REPLY: Expect a reply message, used for | ||||
* method calls. The userspace-supplied | ||||
* cookie identifies the message and th | ||||
e | ||||
* respective reply carries the cookie | ||||
* in cookie_reply | ||||
* @KDBUS_MSG_FLAGS_SYNC_REPLY: Wait for destination connect | ||||
ion to | ||||
* reply to this message. The | ||||
* KDBUS_CMD_MSG_SEND ioctl() will bloc | ||||
k | ||||
* until the reply is received, and | ||||
* offset_reply in struct kdbus_msg wil | ||||
l | ||||
* yield the offset in the sender's poo | ||||
l | ||||
* where the reply can be found. | ||||
* This flag is only valid if | ||||
* @KDBUS_MSG_FLAGS_EXPECT_REPLY is set | ||||
as | ||||
* well. | ||||
* @KDBUS_MSG_FLAGS_NO_AUTO_START: Do not start a service, if the addre | ||||
ssed | ||||
* name is not currently active | ||||
*/ | ||||
enum kdbus_msg_flags { | ||||
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_SYNC_REPLY = 1 << 1, | |||
KDBUS_MSG_FLAGS_NO_AUTO_START = 1 << 2, | ||||
}; | }; | |||
enum { | /** | |||
* enum kdbus_payload_type - type of payload carried by message | ||||
* @KDBUS_PAYLOAD_KERNEL: Kernel-generated simple message | ||||
* @KDBUS_PAYLOAD_DBUS: D-Bus marshalling "DBusDBus" | ||||
*/ | ||||
enum kdbus_payload_type { | ||||
KDBUS_PAYLOAD_KERNEL, | KDBUS_PAYLOAD_KERNEL, | |||
KDBUS_PAYLOAD_DBUS1 = 0x4442757356657231ULL, /* 'DBusVer1' */ | KDBUS_PAYLOAD_DBUS = 0x4442757344427573ULL, | |||
KDBUS_PAYLOAD_GVARIANT = 0x4756617269616e74ULL, /* 'GVariant' */ | ||||
}; | }; | |||
/** | /** | |||
* struct kdbus_msg | * struct kdbus_msg - the representation of a kdbus message | |||
* | * @size: Total size of the message | |||
* set by userspace: | * @flags: Message flags (KDBUS_MSG_FLAGS_*) | |||
* dst_id: destination id | * @priority: Message queue priority value | |||
* flags: KDBUS_MSG_FLAGS_* | * @dst_id: 64-bit ID of the destination connection | |||
* items: data records | * @src_id: 64-bit ID of the source connection | |||
* | * @payload_type: Payload type (KDBUS_PAYLOAD_*) | |||
* set by kernel: | * @cookie: Userspace-supplied cookie, for the connection | |||
* src_id: who sent the message | * to identify its messages | |||
* @timeout_ns: The time to wait for a message reply from th | ||||
e peer. | ||||
* If there is no reply, a kernel-generated message | ||||
* with an attached KDBUS_ITEM_REPLY_TIMEOUT item | ||||
* is sent to @src_id. | ||||
* @cookie_reply: A reply to the requesting message with the same | ||||
* cookie. The requesting connection can match its | ||||
* request and the reply with this value | ||||
* @offset_reply: If KDBUS_MSG_FLAGS_EXPECT_REPLY, this field will | ||||
* contain the offset in the sender's pool where the | ||||
* reply is stored. | ||||
* @items: A list of kdbus_items containing the message payload | ||||
*/ | */ | |||
struct kdbus_msg { | struct kdbus_msg { | |||
__u64 size; | __u64 size; | |||
__u64 flags; | __u64 flags; | |||
__u64 dst_id; /* connection, 0 == name in data, ~0 | __s64 priority; | |||
broadcast */ | __u64 dst_id; | |||
__u64 src_id; /* connection, 0 == kernel */ | __u64 src_id; | |||
__u64 payload_type; /* 'DBusVer1', 'GVariant', ... */ | __u64 payload_type; | |||
__u64 cookie; /* userspace-supplied cookie */ | __u64 cookie; | |||
union { | union { | |||
__u64 cookie_reply; /* cookie we reply to */ | __u64 timeout_ns; | |||
__u64 timeout_ns; /* timespan to wait for reply */ | __u64 cookie_reply; | |||
__u64 offset_reply; | ||||
}; | }; | |||
struct kdbus_item items[0]; | struct kdbus_item items[0]; | |||
}; | } __attribute__((aligned(8))); | |||
enum { | /** | |||
_KDBUS_POLICY_NULL, | * enum kdbus_recv_flags - flags for de-queuing messages | |||
KDBUS_POLICY_NAME, | * @KDBUS_RECV_PEEK: Return the next queued message without | |||
KDBUS_POLICY_ACCESS, | * actually de-queuing it, and without installi | |||
ng | ||||
* any file descriptors or other resources. It | ||||
is | ||||
* usually used to determine the activating | ||||
* connection of a bus name. | ||||
* @KDBUS_RECV_DROP: Drop and free the next queued message and al | ||||
l | ||||
* its resources without actually receiving it. | ||||
* @KDBUS_RECV_USE_PRIORITY: Only de-queue messages with the specified or | ||||
* higher priority (lowest values); if not set, | ||||
* the priority value is ignored. | ||||
*/ | ||||
enum kdbus_recv_flags { | ||||
KDBUS_RECV_PEEK = 1 << 0, | ||||
KDBUS_RECV_DROP = 1 << 1, | ||||
KDBUS_RECV_USE_PRIORITY = 1 << 2, | ||||
}; | }; | |||
enum { | /** | |||
* struct kdbus_cmd_recv - struct to de-queue a buffered message | ||||
* @flags: KDBUS_RECV_* flags | ||||
* @priority: Minimum priority of the messages to de-queue. Lowest | ||||
* values have the highest priority. | ||||
* @offset: Returned offset in the pool where the message is | ||||
* stored. The user must use KDBUS_CMD_FREE to free | ||||
* the allocated memory. | ||||
* | ||||
* This struct is used with the KDBUS_CMD_MSG_RECV ioctl. | ||||
*/ | ||||
struct kdbus_cmd_recv { | ||||
__u64 flags; | ||||
__s64 priority; | ||||
__u64 offset; | ||||
} __attribute__((aligned(8))); | ||||
/** | ||||
* enum kdbus_policy_access_type - permissions of a policy record | ||||
* @_KDBUS_POLICY_ACCESS_NULL: Uninitialized/invalid | ||||
* @KDBUS_POLICY_ACCESS_USER: Grant access to a uid | ||||
* @KDBUS_POLICY_ACCESS_GROUP: Grant access to gid | ||||
* @KDBUS_POLICY_ACCESS_WORLD: World-accessible | ||||
*/ | ||||
enum kdbus_policy_access_type { | ||||
_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 { | /** | |||
KDBUS_POLICY_RECV = 1 << 2, | * enum kdbus_policy_access_flags - mode flags | |||
KDBUS_POLICY_SEND = 1 << 1, | * @KDBUS_POLICY_OWN: Allow to own a well-known name | |||
KDBUS_POLICY_OWN = 1 << 0, | * Implies KDBUS_POLICY_TALK and KDBUS_POLICY_S | |||
}; | EE | |||
* @KDBUS_POLICY_TALK: Allow communication to a well-known name | ||||
struct kdbus_policy_access { | * Implies KDBUS_POLICY_SEE | |||
__u64 type; /* USER, GROUP, WORLD */ | * @KDBUS_POLICY_SEE: Allow to see a well-known name | |||
__u64 bits; /* RECV, SEND, OWN */ | */ | |||
__u64 id; /* uid, gid, 0 */ | enum kdbus_policy_type { | |||
}; | KDBUS_POLICY_SEE = 0, | |||
KDBUS_POLICY_TALK, | ||||
//FIXME: convert access to access[] | KDBUS_POLICY_OWN, | |||
struct kdbus_policy { | ||||
KDBUS_PART_HEADER; | ||||
union { | ||||
char name[0]; | ||||
struct kdbus_policy_access access; | ||||
}; | ||||
}; | }; | |||
/* A series of KDBUS_POLICY_NAME, plus one or more KDBUS_POLICY_ACCESS */ | /** | |||
struct kdbus_cmd_policy { | * enum kdbus_hello_flags - flags for struct kdbus_cmd_hello | |||
__u64 size; | * @KDBUS_HELLO_ACCEPT_FD: The connection allows the receiving of | |||
struct kdbus_policy policies[0]; | * any passed file descriptors | |||
* @KDBUS_HELLO_ACTIVATOR: Special-purpose connection which registers | ||||
* a well-know name for a process to be started | ||||
* when traffic arrives | ||||
* @KDBUS_HELLO_POLICY_HOLDER: Special-purpose connection which registers | ||||
* policy entries for one or multiple names. Th | ||||
e | ||||
* provided names are not activated, and are no | ||||
t | ||||
* registered with the name database | ||||
* @KDBUS_HELLO_MONITOR: Special-purpose connection to monitor | ||||
* bus traffic | ||||
*/ | ||||
enum kdbus_hello_flags { | ||||
KDBUS_HELLO_ACCEPT_FD = 1 << 0, | ||||
KDBUS_HELLO_ACTIVATOR = 1 << 1, | ||||
KDBUS_HELLO_POLICY_HOLDER = 1 << 2, | ||||
KDBUS_HELLO_MONITOR = 1 << 3, | ||||
}; | }; | |||
/* Flags for struct kdbus_cmd_hello */ | /** | |||
enum { | * enum kdbus_attach_flags - flags for metadata attachments | |||
KDBUS_HELLO_STARTER = 1 << 0, | * @KDBUS_ATTACH_TIMESTAMP: Timestamp | |||
KDBUS_HELLO_ACCEPT_FD = 1 << 1, | * @KDBUS_ATTACH_CREDS: Credentials | |||
* @KDBUS_ATTACH_NAMES: Well-known names | ||||
/* The following have an effect on directed messages only -- | * @KDBUS_ATTACH_COMM: The "comm" process identifier | |||
* not for broadcasts */ | * @KDBUS_ATTACH_EXE: The path of the executable | |||
KDBUS_HELLO_ATTACH_COMM = 1 << 10, | * @KDBUS_ATTACH_CMDLINE: The process command line | |||
KDBUS_HELLO_ATTACH_EXE = 1 << 11, | * @KDBUS_ATTACH_CGROUP: The croup membership | |||
KDBUS_HELLO_ATTACH_CMDLINE = 1 << 12, | * @KDBUS_ATTACH_CAPS: The process capabilities | |||
KDBUS_HELLO_ATTACH_CGROUP = 1 << 13, | * @KDBUS_ATTACH_SECLABEL: The security label | |||
KDBUS_HELLO_ATTACH_CAPS = 1 << 14, | * @KDBUS_ATTACH_AUDIT: The audit IDs | |||
KDBUS_HELLO_ATTACH_SECLABEL = 1 << 15, | * @KDBUS_ATTACH_CONN_NAME: The human-readable connection name | |||
KDBUS_HELLO_ATTACH_AUDIT = 1 << 16, | * @_KDBUS_ATTACH_ALL: All of the above | |||
*/ | ||||
enum kdbus_attach_flags { | ||||
KDBUS_ATTACH_TIMESTAMP = 1 << 0, | ||||
KDBUS_ATTACH_CREDS = 1 << 1, | ||||
KDBUS_ATTACH_NAMES = 1 << 2, | ||||
KDBUS_ATTACH_COMM = 1 << 3, | ||||
KDBUS_ATTACH_EXE = 1 << 4, | ||||
KDBUS_ATTACH_CMDLINE = 1 << 5, | ||||
KDBUS_ATTACH_CGROUP = 1 << 6, | ||||
KDBUS_ATTACH_CAPS = 1 << 7, | ||||
KDBUS_ATTACH_SECLABEL = 1 << 8, | ||||
KDBUS_ATTACH_AUDIT = 1 << 9, | ||||
KDBUS_ATTACH_CONN_NAME = 1 << 10, | ||||
_KDBUS_ATTACH_ALL = (1 << 11) - 1, | ||||
}; | }; | |||
/** | ||||
* struct kdbus_cmd_hello - struct to say hello to kdbus | ||||
* @size: The total size of the structure | ||||
* @conn_flags: Connection flags (KDBUS_HELLO_*). The kernel | ||||
will | ||||
* return its capabilities in that field. | ||||
* @attach_flags: Mask of metadata to attach to each message sent | ||||
* (KDBUS_ATTACH_*) | ||||
* @bus_flags: The flags field copied verbatim from the original | ||||
* KDBUS_CMD_BUS_MAKE ioctl. It's intended to be useful | ||||
* to do negotiation of features of the payload that is | ||||
* transferred (kernel → userspace) | ||||
* @id: The ID of this connection (kernel → userspac | ||||
e) | ||||
* @pool_size: Size of the connection's buffer where the received | ||||
* messages are placed | ||||
* @bloom: The bloom properties of the bus, specified | ||||
* by the bus creator (kernel → userspace) | ||||
* @id128: Unique 128-bit ID of the bus (kernel → userspace) | ||||
* @items: A list of items | ||||
* | ||||
* This struct is used with the KDBUS_CMD_HELLO ioctl. | ||||
*/ | ||||
struct kdbus_cmd_hello { | struct kdbus_cmd_hello { | |||
__u64 size; | __u64 size; | |||
__u64 conn_flags; | ||||
/* userspace → kernel, kernel → userspace */ | __u64 attach_flags; | |||
__u64 conn_flags; /* userspace specifies its | __u64 bus_flags; | |||
* capabilities and more, kernel | __u64 id; | |||
* returns its capabilites and | __u64 pool_size; | |||
* more. Kernel might refuse client's | struct kdbus_bloom_parameter bloom; | |||
* capabilities by returning an error | __u8 id128[16]; | |||
* from KDBUS_HELLO */ | ||||
/* kernel → userspace */ | ||||
__u64 bus_flags; /* this is .flags copied verbatim from | ||||
* from original KDBUS_CMD_BUS_MAKE | ||||
* ioctl. It's intended to be useful | ||||
* to do negotiation of features of | ||||
* the payload that is transfreted. */ | ||||
__u64 id; /* id assigned to this connection */ | ||||
__u64 bloom_size; /* The bloom filter size chosen by the | ||||
* bus owner */ | ||||
__u64 pool_size; /* maximum size of pool buffer */ | ||||
struct kdbus_item items[0]; | struct kdbus_item items[0]; | |||
}; | } __attribute__((aligned(8))); | |||
/* Flags for kdbus_cmd_{bus,ep,ns}_make */ | /** | |||
enum { | * enum kdbus_make_flags - Flags for KDBUS_CMD_{BUS,EP,NS}_MAKE | |||
* @KDBUS_MAKE_ACCESS_GROUP: Make the device node group-accessible | ||||
* @KDBUS_MAKE_ACCESS_WORLD: Make the device node world-accessible | ||||
*/ | ||||
enum kdbus_make_flags { | ||||
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, | ||||
}; | }; | |||
/* Items to append to kdbus_cmd_{bus,ep,ns}_make */ | /** | |||
enum { | * struct kdbus_cmd_make - struct to make a bus, an endpoint or a domain | |||
_KDBUS_MAKE_NULL, | * @size: The total size of the struct | |||
KDBUS_MAKE_NAME, | * @flags: Properties for the bus/ep/domain to create | |||
KDBUS_MAKE_CRED, /* allow translator services which connect | * @items: Items describing details | |||
* to the bus on behalf of somebody else, | * | |||
* allow specifiying the credentials of the | * This structure is used with the KDBUS_CMD_BUS_MAKE, KDBUS_CMD_EP_MAKE an | |||
* client to connect on behalf on. Needs | d | |||
* privileges */ | * KDBUS_CMD_DOMAIN_MAKE ioctls. | |||
}; | */ | |||
struct kdbus_cmd_make { | ||||
struct kdbus_cmd_bus_make { | ||||
__u64 size; | ||||
__u64 flags; /* userspace → kernel, kernel → userspace | ||||
* When creating a bus feature | ||||
* kernel negotiation. */ | ||||
__u64 bus_flags; /* userspace → kernel | ||||
* When a bus is created this value is | ||||
* copied verbatim into the bus | ||||
* structure and returned from | ||||
* KDBUS_CMD_HELLO, later */ | ||||
__u64 bloom_size; /* size of the bloom filter for this bus */ | ||||
struct kdbus_item items[0]; | ||||
}; | ||||
struct kdbus_cmd_ep_make { | ||||
__u64 size; | ||||
__u64 flags; /* userspace → kernel, kernel → userspace | ||||
* When creating an entry point | ||||
* feature kernel negotiation done the | ||||
* same way as for | ||||
* KDBUS_CMD_BUS_MAKE. Unused for | ||||
* now. */ | ||||
struct kdbus_item items[0]; | ||||
}; | ||||
struct kdbus_cmd_ns_make { | ||||
__u64 size; | __u64 size; | |||
__u64 flags; /* userspace → kernel, kernel → userspace | __u64 flags; | |||
* When creating an entry point | ||||
* feature kernel negotiation done the | ||||
* same way as for | ||||
* KDBUS_CMD_BUS_MAKE. Unused for | ||||
* now. */ | ||||
struct kdbus_item items[0]; | struct kdbus_item items[0]; | |||
}; | } __attribute__((aligned(8))); | |||
enum { | ||||
/* userspace → kernel */ | ||||
KDBUS_NAME_REPLACE_EXISTING = 1 << 0, | ||||
KDBUS_NAME_QUEUE = 1 << 1, | ||||
KDBUS_NAME_ALLOW_REPLACEMENT = 1 << 2, | ||||
/* kernel → userspace */ | /** | |||
KDBUS_NAME_IN_QUEUE = 1 << 16, | * enum kdbus_name_flags - properties of a well-known name | |||
* @KDBUS_NAME_REPLACE_EXISTING: Try to replace name of other connect | ||||
ions | ||||
* @KDBUS_NAME_ALLOW_REPLACEMENT: Allow the replacement of the name | ||||
* @KDBUS_NAME_QUEUE: Name should be queued if busy | ||||
* @KDBUS_NAME_IN_QUEUE: Name is queued | ||||
* @KDBUS_NAME_ACTIVATOR: Name is owned by a activator connect | ||||
ion | ||||
*/ | ||||
enum kdbus_name_flags { | ||||
KDBUS_NAME_REPLACE_EXISTING = 1 << 0, | ||||
KDBUS_NAME_ALLOW_REPLACEMENT = 1 << 1, | ||||
KDBUS_NAME_QUEUE = 1 << 2, | ||||
KDBUS_NAME_IN_QUEUE = 1 << 3, | ||||
KDBUS_NAME_ACTIVATOR = 1 << 4, | ||||
}; | }; | |||
/* We allow (de)regestration of names of other peers */ | /** | |||
* struct kdbus_cmd_name - struct to describe a well-known name | ||||
* @size: The total size of the struct | ||||
* @flags: Flags for a name entry (KDBUS_NAME_*) | ||||
* @owner_id: The current owner of the name. For requests, | ||||
* privileged users may set this field to | ||||
* (de)register names on behalf of other connections. | ||||
* @conn_flags: The flags of the owning connection (KDBUS_HE | ||||
LLO_*) | ||||
* @name: The well-known name | ||||
* | ||||
* This structure is used with the KDBUS_CMD_NAME_ACQUIRE ioctl. | ||||
*/ | ||||
struct kdbus_cmd_name { | struct kdbus_cmd_name { | |||
__u64 size; | __u64 size; | |||
__u64 flags; | __u64 flags; | |||
__u64 id; | __u64 owner_id; | |||
__u64 conn_flags; | __u64 conn_flags; | |||
char name[0]; | char name[0]; | |||
} __attribute__((aligned(8))); | ||||
/** | ||||
* enum kdbus_name_list_flags - what to include into the returned list | ||||
* @KDBUS_NAME_LIST_UNIQUE: All active connections | ||||
* @KDBUS_NAME_LIST_NAMES: All known well-known names | ||||
* @KDBUS_NAME_LIST_ACTIVATORS: All activator connections | ||||
* @KDBUS_NAME_LIST_QUEUED: All queued-up names | ||||
*/ | ||||
enum kdbus_name_list_flags { | ||||
KDBUS_NAME_LIST_UNIQUE = 1 << 0, | ||||
KDBUS_NAME_LIST_NAMES = 1 << 1, | ||||
KDBUS_NAME_LIST_ACTIVATORS = 1 << 2, | ||||
KDBUS_NAME_LIST_QUEUED = 1 << 3, | ||||
}; | }; | |||
struct kdbus_cmd_names { | /** | |||
* struct kdbus_cmd_name_list - request a list of name entries | ||||
* @flags: Flags for the query (KDBUS_NAME_LIST_*) | ||||
* @offset: The returned offset in the caller's pool buffer. | ||||
* The user must use KDBUS_CMD_FREE to free the | ||||
* allocated memory. | ||||
* | ||||
* This structure is used with the KDBUS_CMD_NAME_LIST ioctl. | ||||
*/ | ||||
struct kdbus_cmd_name_list { | ||||
__u64 flags; | ||||
__u64 offset; | ||||
} __attribute__((aligned(8))); | ||||
/** | ||||
* struct kdbus_name_list - information returned by KDBUS_CMD_NAME_LIST | ||||
* @size: The total size of the structure | ||||
* @names: A list of names | ||||
* | ||||
* Note that the user is responsible for freeing the allocated memory with | ||||
* the KDBUS_CMD_FREE ioctl. | ||||
*/ | ||||
struct kdbus_name_list { | ||||
__u64 size; | __u64 size; | |||
struct kdbus_cmd_name names[0]; | struct kdbus_cmd_name names[0]; | |||
}; | }; | |||
enum { | /** | |||
_KDBUS_NAME_INFO_ITEM_NULL, | * struct kdbus_cmd_conn_info - struct used for KDBUS_CMD_CONN_INFO ioctl | |||
KDBUS_NAME_INFO_ITEM_NAME, /* userspace → kernel */ | * @size: The total size of the struct | |||
KDBUS_NAME_INFO_ITEM_SECLABEL, /* kernel → userspace */ | * @flags: KDBUS_ATTACH_* flags | |||
KDBUS_NAME_INFO_ITEM_AUDIT, /* kernel → userspace */ | * @id: The 64-bit ID of the connection. If set to z | |||
}; | ero, passing | |||
* @name is required. kdbus will look up the name to | ||||
* determine the ID in this case. | ||||
* @offset: Returned offset in the caller's pool buffer where th | ||||
e | ||||
* kdbus_conn_info struct result is stored. The user mu | ||||
st | ||||
* use KDBUS_CMD_FREE to free the allocated memory. | ||||
* @name: The optional well-known name to look up. Only needed | ||||
in | ||||
* case @id is zero. | ||||
* | ||||
* On success, the KDBUS_CMD_CONN_INFO ioctl will return 0 and @offset will | ||||
* tell the user the offset in the connection pool buffer at which to find | ||||
the | ||||
* result in a struct kdbus_conn_info. | ||||
*/ | ||||
struct kdbus_cmd_conn_info { | ||||
__u64 size; | ||||
__u64 flags; | ||||
__u64 id; | ||||
__u64 offset; | ||||
char name[0]; | ||||
} __attribute__((aligned(8))); | ||||
struct kdbus_cmd_name_info { | /** | |||
__u64 size; /* overall size of info */ | * struct kdbus_conn_info - information returned by KDBUS_CMD_CONN_INFO | |||
* @size: The total size of the struct | ||||
* @id: The connection's 64-bit ID | ||||
* @flags: The connection's flags | ||||
* @items: A list of struct kdbus_item | ||||
* | ||||
* Note that the user is responsible for freeing the allocated memory with | ||||
* the KDBUS_CMD_FREE ioctl. | ||||
*/ | ||||
struct kdbus_conn_info { | ||||
__u64 size; | ||||
__u64 id; | ||||
__u64 flags; | __u64 flags; | |||
__u64 id; /* either ID, or 0 and _ITEM_NAME fo | struct kdbus_item items[0]; | |||
llows */ | ||||
struct kdbus_creds creds; | ||||
struct kdbus_item items[0]; /* list of item records */ | ||||
}; | }; | |||
enum { | /** | |||
_KDBUS_MATCH_NULL, | * struct kdbus_cmd_update - update flags of a connection | |||
KDBUS_MATCH_BLOOM, /* Matches a mask blob against KDBUS | * @size: The total size of the struct | |||
_MSG_BLOOM */ | * @items: A list of struct kdbus_item | |||
KDBUS_MATCH_SRC_NAME, /* Matches a name string against KDB | * | |||
US_MSG_SRC_NAMES */ | * This struct is used with the KDBUS_CMD_CONN_UPDATE ioctl. | |||
KDBUS_MATCH_NAME_ADD, /* Matches a name string against KDB | */ | |||
US_MSG_NAME_ADD */ | struct kdbus_cmd_update { | |||
KDBUS_MATCH_NAME_REMOVE, /* Matches a name string against KDB | __u64 size; | |||
US_MSG_NAME_REMOVE */ | struct kdbus_item items[0]; | |||
KDBUS_MATCH_NAME_CHANGE, /* Matches a name string against KDB | } __attribute__((aligned(8))); | |||
US_MSG_NAME_CHANGE */ | ||||
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 */ | ||||
}; | ||||
/** | ||||
* struct kdbus_cmd_match - struct to add or remove matches | ||||
* @size: The total size of the struct | ||||
* @cookie: Userspace supplied cookie. When removing, the cookie | ||||
* identifies the match to remove | ||||
* @items: A list of items for additional information | ||||
* | ||||
* This structure is used with the KDBUS_CMD_ADD_MATCH and | ||||
* KDBUS_CMD_REMOVE_MATCH ioctl. | ||||
*/ | ||||
struct kdbus_cmd_match { | struct kdbus_cmd_match { | |||
__u64 size; | __u64 size; | |||
__u64 id; /* We allow registration/deregestration of matches f | __u64 cookie; | |||
or other peers */ | ||||
__u64 cookie; /* userspace supplied cookie; when removing; kernel | ||||
deletes everything with same cookie */ | ||||
__u64 src_id; /* ~0: any. other: exact unique match */ | ||||
struct kdbus_item items[0]; | struct kdbus_item items[0]; | |||
}; | } __attribute__((aligned(8))); | |||
struct kdbus_cmd_monitor { | /** | |||
__u64 id; /* We allow setting the monitor flag of othe | * struct kdbus_cmd_memfd_make - create a kdbus memfd | |||
r peers */ | * @size: The total size of the struct | |||
unsigned int enable; /* A boolean to enable/disable monitoring */ | * @file_size: The initial file size | |||
* @fd: The returned file descriptor number | ||||
* @__pad: Padding to ensure proper alignement | ||||
* @items: A list of items for additional information | ||||
* | ||||
* This structure is used with the KDBUS_CMD_MEMFD_NEW ioctl. | ||||
*/ | ||||
struct kdbus_cmd_memfd_make { | ||||
__u64 size; | ||||
__u64 file_size; | ||||
int fd; | ||||
__u32 __pad; | __u32 __pad; | |||
}; | struct kdbus_item items[0]; | |||
} __attribute__((aligned(8))); | ||||
/* FD states: | /** | |||
* control nodes: unset | * enum kdbus_ioctl_type - Ioctl API | |||
* bus owner (via KDBUS_CMD_BUS_MAKE) | * @KDBUS_CMD_BUS_MAKE: After opening the "control" device n | |||
* ns owner (via KDBUS_CMD_NS_MAKE) | ode, this | |||
* | * command creates a new bus with the specified | |||
* ep nodes: unset | * name. The bus is immediately shut down and | |||
* connected (via KDBUS_CMD_HELLO) | * cleaned up when the opened "control" device | |||
* starter (via KDBUS_CMD_HELLO with KDBUS_CMD_HELLO_STARTER) | node | |||
* ep owner (via KDBUS_CMD_EP_MAKE) | * is closed. | |||
*/ | * @KDBUS_CMD_DOMAIN_MAKE: Similar to KDBUS_CMD_BUS_MAKE, but it create | |||
enum { | s a | |||
/* kdbus control node commands: require unset state */ | * new kdbus domain. | |||
KDBUS_CMD_BUS_MAKE = _IOW(KDBUS_IOC_MAGIC, 0x00, struct k | * @KDBUS_CMD_EP_MAKE: Creates a new named special endpoint to talk | |||
dbus_cmd_bus_make), | to | |||
KDBUS_CMD_NS_MAKE = _IOR(KDBUS_IOC_MAGIC, 0x10, struct k | * the bus. Such endpoints usually carry a more | |||
dbus_cmd_ns_make), | * restrictive policy and grant restricted acce | |||
ss | ||||
/* kdbus ep node commands: require unset state */ | * to specific applications. | |||
KDBUS_CMD_EP_MAKE = _IOW(KDBUS_IOC_MAGIC, 0x20, struct k | * @KDBUS_CMD_HELLO: By opening the bus device node a connection | |||
dbus_cmd_ep_make), | is | |||
KDBUS_CMD_HELLO = _IOWR(KDBUS_IOC_MAGIC, 0x30, struct | * created. After a HELLO the opened connection | |||
kdbus_cmd_hello), | * becomes an active peer on the bus. | |||
* @KDBUS_CMD_BYEBYE: Disconnect a connection. If the connection's | ||||
/* kdbus ep node commands: require connected state */ | * message list is empty, the calls succeeds, a | |||
KDBUS_CMD_MSG_SEND = _IOW(KDBUS_IOC_MAGIC, 0x40, struct k | nd | |||
dbus_msg), | * the handle is rendered unusable. Otherwise, | |||
KDBUS_CMD_MSG_RECV = _IOR(KDBUS_IOC_MAGIC, 0x41, __u64 *) | * -EAGAIN is returned without any further side | |||
, | - | |||
KDBUS_CMD_MSG_RELEASE = _IOW(KDBUS_IOC_MAGIC, 0x42, __u64 *) | * effects. | |||
, | * @KDBUS_CMD_MSG_SEND: Send a message and pass data from us | |||
erspace to | ||||
KDBUS_CMD_NAME_ACQUIRE = _IOWR(KDBUS_IOC_MAGIC, 0x50, struct | * the kernel. | |||
kdbus_cmd_name), | * @KDBUS_CMD_MSG_RECV: Receive a message from the kernel wh | |||
KDBUS_CMD_NAME_RELEASE = _IOW(KDBUS_IOC_MAGIC, 0x51, struct k | ich is | |||
dbus_cmd_name), | * placed in the receiver's pool. | |||
KDBUS_CMD_NAME_LIST = _IOWR(KDBUS_IOC_MAGIC, 0x52, struct | * @KDBUS_CMD_MSG_CANCEL: Cancel a pending request of a message that | |||
kdbus_cmd_names), | * blocks while waiting for a reply. The parame | |||
KDBUS_CMD_NAME_QUERY = _IOWR(KDBUS_IOC_MAGIC, 0x53, struct | ter | |||
kdbus_cmd_name_info), | * denotes the cookie of the message in flight. | |||
* @KDBUS_CMD_FREE: Release the allocated memory in the receiver | ||||
KDBUS_CMD_MATCH_ADD = _IOW(KDBUS_IOC_MAGIC, 0x60, struct k | 's | |||
dbus_cmd_match), | * pool. | |||
KDBUS_CMD_MATCH_REMOVE = _IOW(KDBUS_IOC_MAGIC, 0x61, struct k | * @KDBUS_CMD_NAME_ACQUIRE: Request a well-known bus name to associate w | |||
dbus_cmd_match), | ith | |||
KDBUS_CMD_MONITOR = _IOW(KDBUS_IOC_MAGIC, 0x62, struct k | * the connection. Well-known names are used to | |||
dbus_cmd_monitor), | * address a peer on the bus. | |||
* @KDBUS_CMD_NAME_RELEASE: Release a well-known name the connection | ||||
/* kdbus ep node commands: require ep owner state */ | * currently owns. | |||
KDBUS_CMD_EP_POLICY_SET = _IOW(KDBUS_IOC_MAGIC, 0x70, struct k | * @KDBUS_CMD_NAME_LIST: Retrieve the list of all currently registere | |||
dbus_cmd_policy), | d | |||
* well-known and unique names. | ||||
/* kdbus memfd commands: */ | * @KDBUS_CMD_CONN_INFO: Retrieve credentials and properties of the | |||
KDBUS_CMD_MEMFD_NEW = _IOR(KDBUS_IOC_MAGIC, 0x80, int *), | * initial creator of the connection. The data | |||
KDBUS_CMD_MEMFD_SIZE_GET = _IOR(KDBUS_IOC_MAGIC, 0x81, __u64 *) | was | |||
, | * stored at registration time and does not | |||
KDBUS_CMD_MEMFD_SIZE_SET = _IOW(KDBUS_IOC_MAGIC, 0x82, __u64 *) | * necessarily represent the connected process | |||
, | or | |||
KDBUS_CMD_MEMFD_SEAL_GET = _IOR(KDBUS_IOC_MAGIC, 0x83, int *), | * the actual state of the process. | |||
KDBUS_CMD_MEMFD_SEAL_SET = _IO(KDBUS_IOC_MAGIC, 0x84), | * @KDBUS_CMD_CONN_UPDATE: Update the properties of a connection. Used | |||
}; | to | |||
* update the metadata subscription mask and | ||||
* policy. | ||||
* @KDBUS_CMD_EP_UPDATE: Update the properties of a custom enpoint. U | ||||
sed | ||||
* to update the policy. | ||||
* @KDBUS_CMD_MATCH_ADD: Install a match which broadcast messages sho | ||||
uld | ||||
* be delivered to the connection. | ||||
* @KDBUS_CMD_MATCH_REMOVE: Remove a current match for broadcast message | ||||
s. | ||||
* @KDBUS_CMD_MEMFD_NEW: Return a new file descriptor which provides | ||||
an | ||||
* anonymous shared memory file and which can b | ||||
e | ||||
* used to pass around larger chunks of data. | ||||
* Kdbus memfd files can be sealed, which allow | ||||
s | ||||
* the receiver to trust the data it has receiv | ||||
ed. | ||||
* Kdbus memfd files expose only very limited | ||||
* operations, they can be mmap()ed, seek()ed, | ||||
* (p)read(v)() and (p)write(v)(); most other | ||||
* common file operations are not implemented. | ||||
* Special caution needs to be taken with | ||||
* read(v)()/write(v)() on a shared file; the | ||||
* underlying file position is always shared | ||||
* between all users of the file and race again | ||||
st | ||||
* each other, pread(v)()/pwrite(v)() avoid the | ||||
se | ||||
* issues. | ||||
* @KDBUS_CMD_MEMFD_SIZE_GET: Return the size of the underlying file, whic | ||||
h | ||||
* changes with write(). | ||||
* @KDBUS_CMD_MEMFD_SIZE_SET: Truncate the underlying file to the specifie | ||||
d | ||||
* size. | ||||
* @KDBUS_CMD_MEMFD_SEAL_GET: Return the state of the file sealing. | ||||
* @KDBUS_CMD_MEMFD_SEAL_SET: Seal or break a seal of the file. Only files | ||||
* which are not shared with other processes an | ||||
d | ||||
* which are currently not mapped can be sealed | ||||
. | ||||
* The current process needs to be the one and | ||||
* single owner of the file, the sealing cannot | ||||
* be changed as long as the file is shared. | ||||
*/ | ||||
enum kdbus_ioctl_type { | ||||
KDBUS_CMD_BUS_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x00, | ||||
struct kdbus_cmd_make), | ||||
KDBUS_CMD_DOMAIN_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x10, | ||||
struct kdbus_cmd_make), | ||||
KDBUS_CMD_EP_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x20, | ||||
struct kdbus_cmd_make), | ||||
KDBUS_CMD_HELLO = _IOWR(KDBUS_IOCTL_MAGIC, 0x30, | ||||
struct kdbus_cmd_hello), | ||||
KDBUS_CMD_BYEBYE = _IO(KDBUS_IOCTL_MAGIC, 0x31), | ||||
KDBUS_CMD_MSG_SEND = _IOWR(KDBUS_IOCTL_MAGIC, 0x40, | ||||
struct kdbus_msg), | ||||
KDBUS_CMD_MSG_RECV = _IOWR(KDBUS_IOCTL_MAGIC, 0x41, | ||||
struct kdbus_cmd_recv), | ||||
KDBUS_CMD_MSG_CANCEL = _IOW(KDBUS_IOCTL_MAGIC, 0x42, __u64 | ||||
*), | ||||
KDBUS_CMD_FREE = _IOW(KDBUS_IOCTL_MAGIC, 0x43, __u64 | ||||
*), | ||||
KDBUS_CMD_NAME_ACQUIRE = _IOWR(KDBUS_IOCTL_MAGIC, 0x50, | ||||
struct kdbus_cmd_name), | ||||
KDBUS_CMD_NAME_RELEASE = _IOW(KDBUS_IOCTL_MAGIC, 0x51, | ||||
struct kdbus_cmd_name), | ||||
KDBUS_CMD_NAME_LIST = _IOWR(KDBUS_IOCTL_MAGIC, 0x52, | ||||
struct kdbus_cmd_name_list), | ||||
KDBUS_CMD_CONN_INFO = _IOWR(KDBUS_IOCTL_MAGIC, 0x60, | ||||
struct kdbus_cmd_conn_info), | ||||
KDBUS_CMD_CONN_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x61, | ||||
struct kdbus_cmd_update), | ||||
KDBUS_CMD_EP_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x71, | ||||
struct kdbus_cmd_update), | ||||
KDBUS_CMD_MATCH_ADD = _IOW(KDBUS_IOCTL_MAGIC, 0x80, | ||||
struct kdbus_cmd_match), | ||||
KDBUS_CMD_MATCH_REMOVE = _IOW(KDBUS_IOCTL_MAGIC, 0x81, | ||||
struct kdbus_cmd_match), | ||||
KDBUS_CMD_MEMFD_NEW = _IOWR(KDBUS_IOCTL_MAGIC, 0xc0, | ||||
struct kdbus_cmd_memfd_make), | ||||
KDBUS_CMD_MEMFD_SIZE_GET = _IOR(KDBUS_IOCTL_MAGIC, 0xc1, __u64 | ||||
*), | ||||
KDBUS_CMD_MEMFD_SIZE_SET = _IOW(KDBUS_IOCTL_MAGIC, 0xc2, __u64 | ||||
*), | ||||
KDBUS_CMD_MEMFD_SEAL_GET = _IOR(KDBUS_IOCTL_MAGIC, 0xc3, int *) | ||||
, | ||||
KDBUS_CMD_MEMFD_SEAL_SET = _IO(KDBUS_IOCTL_MAGIC, 0xc4), | ||||
}; | ||||
/* | ||||
* errno - api error codes | ||||
* @E2BIG: A message contains too many records or items. | ||||
* @EADDRINUSE: A well-known bus name is already taken by an | ||||
other | ||||
* connection. | ||||
* @EADDRNOTAVAIL: A message flagged not to activate a service, address | ||||
ed | ||||
* a service which is not currently running. | ||||
* @EAGAIN: No messages are queued at the moment. | ||||
* @EALREADY: A requested name is already owned by the connection, | ||||
* a connection is already disconnected, memfd is alrea | ||||
dy | ||||
* sealed or has the requested size. | ||||
* @EBADF: File descriptors passed with the message are not val | ||||
id. | ||||
* @EBADFD: A bus connection is in a corrupted state. | ||||
* @EBADMSG: Passed data contains a combination of conflicting or | ||||
* inconsistent types. | ||||
* @EBUSY: The user tried to say BYEBYE to a connection, but th | ||||
e | ||||
* connection had a non-empty message list. | ||||
* @ECANCELED: A synchronous message sending was cancelled. | ||||
* @ECONNRESET: A connection is shut down, no further operat | ||||
ions are | ||||
* possible. | ||||
* @ECOMM: A peer does not accept the file descriptors addresse | ||||
d | ||||
* to it. | ||||
* @EDESTADDRREQ: The well-known bus name is required but missing. | ||||
* @EDOM: The size of data does not match the expectations. Us | ||||
ed | ||||
* for bloom bit field sizes. | ||||
* @EEXIST: A requested domain, bus or endpoint with the same | ||||
* name already exists. A specific data type, which is | ||||
* only expected once, is provided multiple times. | ||||
* @EFAULT: The supplied memory could not be accessed, or the da | ||||
ta | ||||
* is not properly aligned. | ||||
* @EINVAL: The provided data does not match its type or other | ||||
* expectations, like a string which is not NUL termina | ||||
ted, | ||||
* or a string length that points behind the first | ||||
* \0-byte in the string. | ||||
* @EMEDIUMTYPE: A file descriptor which is not a kdbus memfd was | ||||
* refused to send as KDBUS_MSG_PAYLOAD_MEMFD. | ||||
* @EMFILE: Too many file descriptors have been supplied with a | ||||
* message. | ||||
* Too many connections or buses are created for a give | ||||
n | ||||
* user. | ||||
* @EMLINK: Too many requests from this connection to other peer | ||||
s | ||||
* are queued and waiting for a reply | ||||
* @EMSGSIZE: The supplied data is larger than the allowed maximum | ||||
* size. | ||||
* @ENAMETOOLONG: The requested name is larger than the allowed maximu | ||||
m | ||||
* size. | ||||
* @ENOBUFS: There is no space left for the submitted data to fit | ||||
* into the receiver's pool. | ||||
* @ENOENT: The to be cancelled message was not found. | ||||
* @ENOMEM: Out of memory. | ||||
* @ENOMSG: The queue is not empty, but no message with a matchi | ||||
ng | ||||
* priority is currently queued. | ||||
* @ENOSYS: The requested functionality is not available. | ||||
* @ENOTTY: An unknown ioctl command was received. | ||||
* @ENOTUNIQ: A specific data type was addressed to a broadcast | ||||
* address, but only direct addresses support this kind | ||||
of | ||||
* data. | ||||
* @ENXIO: A unique address does not exist, or an offset in the | ||||
* receiver's pool does not represent a queued message. | ||||
* @EOPNOTSUPP: The feature negotiation failed, a not suppor | ||||
ted feature | ||||
* was requested, or an unknown item type was received. | ||||
* @EPERM: The policy prevented an operation. The requested | ||||
* resource is owned by another entity. | ||||
* @EPIPE: When sending a message, a synchronous reply from the | ||||
* receiving connection was expected but the connection | ||||
* died before answering. | ||||
* @ESHUTDOWN: A domain, bus or endpoint is currently shutting down | ||||
; | ||||
* no further operations will be possible. | ||||
* @ESRCH: A requested well-known bus name is not found. | ||||
* @ETIMEDOUT: A synchronous wait for a message reply did not arriv | ||||
e | ||||
* within the specified time frame. | ||||
* @ETXTBSY: A kdbus memfd file cannot be sealed or the seal remo | ||||
ved, | ||||
* because it is shared with other processes or still | ||||
* mmap()ed. | ||||
* @EXFULL: The size limits in the pool are reached, no data of | ||||
* the size tried to submit can be queued. | ||||
*/ | ||||
#endif | #endif | |||
End of changes. 57 change blocks. | ||||
329 lines changed or deleted | 887 lines changed or added | |||
keyboard-keys-to-name.h | keyboard-keys-to-name.h | |||
---|---|---|---|---|
skipping to change at line 18 | skipping to change at line 18 | |||
[KEY_DVD] = "KEY_DVD", | [KEY_DVD] = "KEY_DVD", | |||
[KEY_FN_F10] = "KEY_FN_F10", | [KEY_FN_F10] = "KEY_FN_F10", | |||
[KEY_FN_F11] = "KEY_FN_F11", | [KEY_FN_F11] = "KEY_FN_F11", | |||
[KEY_FN_F12] = "KEY_FN_F12", | [KEY_FN_F12] = "KEY_FN_F12", | |||
[KEY_FRAMEBACK] = "KEY_FRAMEBACK", | [KEY_FRAMEBACK] = "KEY_FRAMEBACK", | |||
[KEY_BRL_DOT10] = "KEY_BRL_DOT10", | [KEY_BRL_DOT10] = "KEY_BRL_DOT10", | |||
[KEY_SLEEP] = "KEY_SLEEP", | [KEY_SLEEP] = "KEY_SLEEP", | |||
[KEY_VCR2] = "KEY_VCR2", | [KEY_VCR2] = "KEY_VCR2", | |||
[KEY_ZENKAKUHANKAKU] = "KEY_ZENKAKUHANKAKU", | [KEY_ZENKAKUHANKAKU] = "KEY_ZENKAKUHANKAKU", | |||
[KEY_IMAGES] = "KEY_IMAGES", | [KEY_IMAGES] = "KEY_IMAGES", | |||
[KEY_DOCUMENTS] = "KEY_DOCUMENTS", | ||||
[KEY_LEFTMETA] = "KEY_LEFTMETA", | [KEY_LEFTMETA] = "KEY_LEFTMETA", | |||
[KEY_OPEN] = "KEY_OPEN", | [KEY_OPEN] = "KEY_OPEN", | |||
[KEY_BATTERY] = "KEY_BATTERY", | [KEY_BATTERY] = "KEY_BATTERY", | |||
[KEY_MACRO] = "KEY_MACRO", | [KEY_MACRO] = "KEY_MACRO", | |||
[KEY_MODE] = "KEY_MODE", | [KEY_MODE] = "KEY_MODE", | |||
[KEY_GREEN] = "KEY_GREEN", | [KEY_GREEN] = "KEY_GREEN", | |||
[KEY_SAT] = "KEY_SAT", | [KEY_SAT] = "KEY_SAT", | |||
[KEY_RIGHTMETA] = "KEY_RIGHTMETA", | [KEY_RIGHTMETA] = "KEY_RIGHTMETA", | |||
[KEY_COMPUTER] = "KEY_COMPUTER", | [KEY_COMPUTER] = "KEY_COMPUTER", | |||
[KEY_SELECT] = "KEY_SELECT", | [KEY_SELECT] = "KEY_SELECT", | |||
skipping to change at line 78 | skipping to change at line 79 | |||
[KEY_HENKAN] = "KEY_HENKAN", | [KEY_HENKAN] = "KEY_HENKAN", | |||
[KEY_DISPLAYTOGGLE] = "KEY_DISPLAYTOGGLE", | [KEY_DISPLAYTOGGLE] = "KEY_DISPLAYTOGGLE", | |||
[KEY_RIGHTALT] = "KEY_RIGHTALT", | [KEY_RIGHTALT] = "KEY_RIGHTALT", | |||
[KEY_SPORT] = "KEY_SPORT", | [KEY_SPORT] = "KEY_SPORT", | |||
[KEY_POWER] = "KEY_POWER", | [KEY_POWER] = "KEY_POWER", | |||
[KEY_APOSTROPHE] = "KEY_APOSTROPHE", | [KEY_APOSTROPHE] = "KEY_APOSTROPHE", | |||
[KEY_SCREEN] = "KEY_SCREEN", | [KEY_SCREEN] = "KEY_SCREEN", | |||
[KEY_RADIO] = "KEY_RADIO", | [KEY_RADIO] = "KEY_RADIO", | |||
[KEY_DATABASE] = "KEY_DATABASE", | [KEY_DATABASE] = "KEY_DATABASE", | |||
[KEY_VOLUMEDOWN] = "KEY_VOLUMEDOWN", | [KEY_VOLUMEDOWN] = "KEY_VOLUMEDOWN", | |||
[KEY_END] = "KEY_END", | ||||
[KEY_SENDFILE] = "KEY_SENDFILE", | [KEY_SENDFILE] = "KEY_SENDFILE", | |||
[KEY_RIGHTSHIFT] = "KEY_RIGHTSHIFT", | [KEY_RIGHTSHIFT] = "KEY_RIGHTSHIFT", | |||
[KEY_ARCHIVE] = "KEY_ARCHIVE", | [KEY_ARCHIVE] = "KEY_ARCHIVE", | |||
[KEY_NUMERIC_POUND] = "KEY_NUMERIC_POUND", | [KEY_NUMERIC_POUND] = "KEY_NUMERIC_POUND", | |||
[KEY_EPG] = "KEY_EPG", | [KEY_EPG] = "KEY_EPG", | |||
[KEY_NEXTSONG] = "KEY_NEXTSONG", | [KEY_NEXTSONG] = "KEY_NEXTSONG", | |||
[KEY_FIRST] = "KEY_FIRST", | [KEY_FIRST] = "KEY_FIRST", | |||
[KEY_SPREADSHEET] = "KEY_SPREADSHEET", | [KEY_SPREADSHEET] = "KEY_SPREADSHEET", | |||
[KEY_KPSLASH] = "KEY_KPSLASH", | [KEY_KPSLASH] = "KEY_KPSLASH", | |||
[KEY_BACK] = "KEY_BACK", | [KEY_BACK] = "KEY_BACK", | |||
skipping to change at line 116 | skipping to change at line 116 | |||
[KEY_TAB] = "KEY_TAB", | [KEY_TAB] = "KEY_TAB", | |||
[KEY_UNKNOWN] = "KEY_UNKNOWN", | [KEY_UNKNOWN] = "KEY_UNKNOWN", | |||
[KEY_KPLEFTPAREN] = "KEY_KPLEFTPAREN", | [KEY_KPLEFTPAREN] = "KEY_KPLEFTPAREN", | |||
[KEY_EDITOR] = "KEY_EDITOR", | [KEY_EDITOR] = "KEY_EDITOR", | |||
[KEY_EMAIL] = "KEY_EMAIL", | [KEY_EMAIL] = "KEY_EMAIL", | |||
[KEY_102ND] = "KEY_102ND", | [KEY_102ND] = "KEY_102ND", | |||
[KEY_MENU] = "KEY_MENU", | [KEY_MENU] = "KEY_MENU", | |||
[KEY_SPACE] = "KEY_SPACE", | [KEY_SPACE] = "KEY_SPACE", | |||
[KEY_INFO] = "KEY_INFO", | [KEY_INFO] = "KEY_INFO", | |||
[KEY_WAKEUP] = "KEY_WAKEUP", | [KEY_WAKEUP] = "KEY_WAKEUP", | |||
[KEY_SEMICOLON] = "KEY_SEMICOLON", | ||||
[KEY_BLUE] = "KEY_BLUE", | [KEY_BLUE] = "KEY_BLUE", | |||
[KEY_HOMEPAGE] = "KEY_HOMEPAGE", | [KEY_HOMEPAGE] = "KEY_HOMEPAGE", | |||
[KEY_DIGITS] = "KEY_DIGITS", | ||||
[KEY_KPCOMMA] = "KEY_KPCOMMA", | [KEY_KPCOMMA] = "KEY_KPCOMMA", | |||
[KEY_ZOOMRESET] = "KEY_ZOOMRESET", | [KEY_ZOOMRESET] = "KEY_ZOOMRESET", | |||
[KEY_FAVORITES] = "KEY_FAVORITES", | [KEY_FAVORITES] = "KEY_FAVORITES", | |||
[KEY_TOUCHPAD_ON] = "KEY_TOUCHPAD_ON", | [KEY_TOUCHPAD_ON] = "KEY_TOUCHPAD_ON", | |||
[KEY_FN_1] = "KEY_FN_1", | [KEY_FN_1] = "KEY_FN_1", | |||
[KEY_FN_2] = "KEY_FN_2", | [KEY_FN_2] = "KEY_FN_2", | |||
[KEY_ISO] = "KEY_ISO", | [KEY_ISO] = "KEY_ISO", | |||
[KEY_FN_D] = "KEY_FN_D", | [KEY_FN_D] = "KEY_FN_D", | |||
[KEY_FN_E] = "KEY_FN_E", | [KEY_FN_E] = "KEY_FN_E", | |||
[KEY_FN_F] = "KEY_FN_F", | [KEY_FN_F] = "KEY_FN_F", | |||
skipping to change at line 147 | skipping to change at line 149 | |||
[KEY_F10] = "KEY_F10", | [KEY_F10] = "KEY_F10", | |||
[KEY_F11] = "KEY_F11", | [KEY_F11] = "KEY_F11", | |||
[KEY_F12] = "KEY_F12", | [KEY_F12] = "KEY_F12", | |||
[KEY_F13] = "KEY_F13", | [KEY_F13] = "KEY_F13", | |||
[KEY_F14] = "KEY_F14", | [KEY_F14] = "KEY_F14", | |||
[KEY_F15] = "KEY_F15", | [KEY_F15] = "KEY_F15", | |||
[KEY_F16] = "KEY_F16", | [KEY_F16] = "KEY_F16", | |||
[KEY_F17] = "KEY_F17", | [KEY_F17] = "KEY_F17", | |||
[KEY_F18] = "KEY_F18", | [KEY_F18] = "KEY_F18", | |||
[KEY_F19] = "KEY_F19", | [KEY_F19] = "KEY_F19", | |||
[KEY_SEMICOLON] = "KEY_SEMICOLON", | ||||
[KEY_F20] = "KEY_F20", | [KEY_F20] = "KEY_F20", | |||
[KEY_F22] = "KEY_F22", | [KEY_F22] = "KEY_F22", | |||
[KEY_F23] = "KEY_F23", | [KEY_F23] = "KEY_F23", | |||
[KEY_F24] = "KEY_F24", | [KEY_F24] = "KEY_F24", | |||
[KEY_SAVE] = "KEY_SAVE", | [KEY_SAVE] = "KEY_SAVE", | |||
[KEY_0] = "KEY_0", | [KEY_0] = "KEY_0", | |||
[KEY_1] = "KEY_1", | [KEY_1] = "KEY_1", | |||
[KEY_2] = "KEY_2", | [KEY_2] = "KEY_2", | |||
[KEY_3] = "KEY_3", | [KEY_3] = "KEY_3", | |||
[KEY_4] = "KEY_4", | [KEY_4] = "KEY_4", | |||
skipping to change at line 194 | skipping to change at line 195 | |||
[KEY_F5] = "KEY_F5", | [KEY_F5] = "KEY_F5", | |||
[KEY_RECORD] = "KEY_RECORD", | [KEY_RECORD] = "KEY_RECORD", | |||
[KEY_F7] = "KEY_F7", | [KEY_F7] = "KEY_F7", | |||
[KEY_CHANNEL] = "KEY_CHANNEL", | [KEY_CHANNEL] = "KEY_CHANNEL", | |||
[KEY_EJECTCD] = "KEY_EJECTCD", | [KEY_EJECTCD] = "KEY_EJECTCD", | |||
[KEY_VIDEOPHONE] = "KEY_VIDEOPHONE", | [KEY_VIDEOPHONE] = "KEY_VIDEOPHONE", | |||
[KEY_VIDEO] = "KEY_VIDEO", | [KEY_VIDEO] = "KEY_VIDEO", | |||
[KEY_VENDOR] = "KEY_VENDOR", | [KEY_VENDOR] = "KEY_VENDOR", | |||
[KEY_MP3] = "KEY_MP3", | [KEY_MP3] = "KEY_MP3", | |||
[KEY_AGAIN] = "KEY_AGAIN", | [KEY_AGAIN] = "KEY_AGAIN", | |||
[KEY_DIGITS] = "KEY_DIGITS", | ||||
[KEY_SEND] = "KEY_SEND", | [KEY_SEND] = "KEY_SEND", | |||
[KEY_COMMA] = "KEY_COMMA", | [KEY_COMMA] = "KEY_COMMA", | |||
[KEY_GRAPHICSEDITOR] = "KEY_GRAPHICSEDITOR", | [KEY_GRAPHICSEDITOR] = "KEY_GRAPHICSEDITOR", | |||
[KEY_A] = "KEY_A", | [KEY_A] = "KEY_A", | |||
[KEY_J] = "KEY_J", | [KEY_J] = "KEY_J", | |||
[KEY_YELLOW] = "KEY_YELLOW", | [KEY_YELLOW] = "KEY_YELLOW", | |||
[KEY_LEFTBRACE] = "KEY_LEFTBRACE", | [KEY_LEFTBRACE] = "KEY_LEFTBRACE", | |||
[KEY_N] = "KEY_N", | [KEY_N] = "KEY_N", | |||
[KEY_QUESTION] = "KEY_QUESTION", | [KEY_QUESTION] = "KEY_QUESTION", | |||
[KEY_LANGUAGE] = "KEY_LANGUAGE", | [KEY_LANGUAGE] = "KEY_LANGUAGE", | |||
skipping to change at line 235 | skipping to change at line 235 | |||
[KEY_YEN] = "KEY_YEN", | [KEY_YEN] = "KEY_YEN", | |||
[KEY_PLAY] = "KEY_PLAY", | [KEY_PLAY] = "KEY_PLAY", | |||
[KEY_REWIND] = "KEY_REWIND", | [KEY_REWIND] = "KEY_REWIND", | |||
[KEY_VIDEO_NEXT] = "KEY_VIDEO_NEXT", | [KEY_VIDEO_NEXT] = "KEY_VIDEO_NEXT", | |||
[KEY_DIRECTION] = "KEY_DIRECTION", | [KEY_DIRECTION] = "KEY_DIRECTION", | |||
[KEY_TOUCHPAD_OFF] = "KEY_TOUCHPAD_OFF", | [KEY_TOUCHPAD_OFF] = "KEY_TOUCHPAD_OFF", | |||
[KEY_HELP] = "KEY_HELP", | [KEY_HELP] = "KEY_HELP", | |||
[KEY_NUMERIC_STAR] = "KEY_NUMERIC_STAR", | [KEY_NUMERIC_STAR] = "KEY_NUMERIC_STAR", | |||
[KEY_BACKSLASH] = "KEY_BACKSLASH", | [KEY_BACKSLASH] = "KEY_BACKSLASH", | |||
[KEY_SYSRQ] = "KEY_SYSRQ", | [KEY_SYSRQ] = "KEY_SYSRQ", | |||
[KEY_END] = "KEY_END", | ||||
[KEY_RFKILL] = "KEY_RFKILL", | [KEY_RFKILL] = "KEY_RFKILL", | |||
[KEY_LEFTCTRL] = "KEY_LEFTCTRL", | [KEY_LEFTCTRL] = "KEY_LEFTCTRL", | |||
[KEY_KPRIGHTPAREN] = "KEY_KPRIGHTPAREN", | [KEY_KPRIGHTPAREN] = "KEY_KPRIGHTPAREN", | |||
[KEY_KPASTERISK] = "KEY_KPASTERISK", | [KEY_KPASTERISK] = "KEY_KPASTERISK", | |||
[KEY_REFRESH] = "KEY_REFRESH", | [KEY_REFRESH] = "KEY_REFRESH", | |||
[KEY_CLOSECD] = "KEY_CLOSECD", | [KEY_CLOSECD] = "KEY_CLOSECD", | |||
[KEY_RIGHTCTRL] = "KEY_RIGHTCTRL", | [KEY_RIGHTCTRL] = "KEY_RIGHTCTRL", | |||
[KEY_KEYBOARD] = "KEY_KEYBOARD", | ||||
[KEY_SEARCH] = "KEY_SEARCH", | [KEY_SEARCH] = "KEY_SEARCH", | |||
[KEY_PHONE] = "KEY_PHONE", | [KEY_PHONE] = "KEY_PHONE", | |||
[KEY_KBDILLUMUP] = "KEY_KBDILLUMUP", | [KEY_KBDILLUMUP] = "KEY_KBDILLUMUP", | |||
[KEY_STOP] = "KEY_STOP", | [KEY_STOP] = "KEY_STOP", | |||
[KEY_BRIGHTNESS_ZERO] = "KEY_BRIGHTNESS_ZERO", | [KEY_BRIGHTNESS_ZERO] = "KEY_BRIGHTNESS_ZERO", | |||
[KEY_CHAT] = "KEY_CHAT", | [KEY_CHAT] = "KEY_CHAT", | |||
[KEY_VOLUMEUP] = "KEY_VOLUMEUP", | [KEY_VOLUMEUP] = "KEY_VOLUMEUP", | |||
[KEY_CAMERA_ZOOMIN] = "KEY_CAMERA_ZOOMIN", | [KEY_CAMERA_ZOOMIN] = "KEY_CAMERA_ZOOMIN", | |||
[KEY_UNDO] = "KEY_UNDO", | [KEY_UNDO] = "KEY_UNDO", | |||
[KEY_TUNER] = "KEY_TUNER", | [KEY_TUNER] = "KEY_TUNER", | |||
skipping to change at line 377 | skipping to change at line 379 | |||
[KEY_KPJPCOMMA] = "KEY_KPJPCOMMA", | [KEY_KPJPCOMMA] = "KEY_KPJPCOMMA", | |||
[KEY_10CHANNELSUP] = "KEY_10CHANNELSUP", | [KEY_10CHANNELSUP] = "KEY_10CHANNELSUP", | |||
[KEY_TV] = "KEY_TV", | [KEY_TV] = "KEY_TV", | |||
[KEY_UP] = "KEY_UP", | [KEY_UP] = "KEY_UP", | |||
[KEY_SUSPEND] = "KEY_SUSPEND", | [KEY_SUSPEND] = "KEY_SUSPEND", | |||
[KEY_FILE] = "KEY_FILE", | [KEY_FILE] = "KEY_FILE", | |||
[KEY_TIME] = "KEY_TIME", | [KEY_TIME] = "KEY_TIME", | |||
[KEY_FIND] = "KEY_FIND", | [KEY_FIND] = "KEY_FIND", | |||
[KEY_STOPCD] = "KEY_STOPCD", | [KEY_STOPCD] = "KEY_STOPCD", | |||
[KEY_SPELLCHECK] = "KEY_SPELLCHECK", | [KEY_SPELLCHECK] = "KEY_SPELLCHECK", | |||
[KEY_DOCUMENTS] = "KEY_DOCUMENTS", | ||||
[KEY_LEFT] = "KEY_LEFT", | [KEY_LEFT] = "KEY_LEFT", | |||
[KEY_EJECTCLOSECD] = "KEY_EJECTCLOSECD", | [KEY_EJECTCLOSECD] = "KEY_EJECTCLOSECD", | |||
[KEY_KPMINUS] = "KEY_KPMINUS", | [KEY_KPMINUS] = "KEY_KPMINUS", | |||
[KEY_GOTO] = "KEY_GOTO", | [KEY_GOTO] = "KEY_GOTO", | |||
[KEY_MEDIA_REPEAT] = "KEY_MEDIA_REPEAT", | [KEY_MEDIA_REPEAT] = "KEY_MEDIA_REPEAT", | |||
[KEY_MEMO] = "KEY_MEMO", | [KEY_MEMO] = "KEY_MEMO", | |||
[KEY_SLASH] = "KEY_SLASH", | [KEY_SLASH] = "KEY_SLASH", | |||
[KEY_KEYBOARD] = "KEY_KEYBOARD", | ||||
[KEY_CAMERA_UP] = "KEY_CAMERA_UP", | [KEY_CAMERA_UP] = "KEY_CAMERA_UP", | |||
[KEY_DEL_LINE] = "KEY_DEL_LINE", | [KEY_DEL_LINE] = "KEY_DEL_LINE", | |||
[KEY_CLOSE] = "KEY_CLOSE", | [KEY_CLOSE] = "KEY_CLOSE", | |||
[KEY_DOT] = "KEY_DOT", | [KEY_DOT] = "KEY_DOT", | |||
[KEY_NUMERIC_6] = "KEY_NUMERIC_6", | [KEY_NUMERIC_6] = "KEY_NUMERIC_6", | |||
[KEY_HANGEUL] = "KEY_HANGEUL", | [KEY_HANGEUL] = "KEY_HANGEUL", | |||
[KEY_BOOKMARKS] = "KEY_BOOKMARKS", | [KEY_BOOKMARKS] = "KEY_BOOKMARKS", | |||
}; | }; | |||
End of changes. 10 change blocks. | ||||
5 lines changed or deleted | 5 lines changed or added | |||
kill.h | kill.h | |||
---|---|---|---|---|
skipping to change at line 35 | skipping to change at line 35 | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#include "macro.h" | #include "macro.h" | |||
typedef enum KillMode { | typedef enum KillMode { | |||
/* The kill mode is a property of a unit. */ | /* The kill mode is a property of a unit. */ | |||
KILL_CONTROL_GROUP = 0, | KILL_CONTROL_GROUP = 0, | |||
KILL_PROCESS, | KILL_PROCESS, | |||
KILL_MIXED, | ||||
KILL_NONE, | KILL_NONE, | |||
_KILL_MODE_MAX, | _KILL_MODE_MAX, | |||
_KILL_MODE_INVALID = -1 | _KILL_MODE_INVALID = -1 | |||
} KillMode; | } KillMode; | |||
struct KillContext { | struct KillContext { | |||
KillMode kill_mode; | KillMode kill_mode; | |||
int kill_signal; | int kill_signal; | |||
bool send_sigkill; | bool send_sigkill; | |||
bool send_sighup; | bool send_sighup; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
killall.h | killall.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fookillallhfoo | #pragma once | |||
#define fookillallhfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2012 Lennart Poettering | Copyright 2012 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/>. | |||
***/ | ***/ | |||
void broadcast_signal(int sig, bool wait); | void broadcast_signal(int sig, bool wait_for_exit, bool send_sighup); | |||
#endif | ||||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added | |||
label.h | label.h | |||
---|---|---|---|---|
skipping to change at line 45 | skipping to change at line 45 | |||
int label_context_set(const char *path, mode_t mode); | int label_context_set(const char *path, mode_t mode); | |||
void label_context_clear(void); | void label_context_clear(void); | |||
void label_free(const char *label); | void label_free(const char *label); | |||
int label_get_create_label_from_exe(const char *exe, char **label); | int label_get_create_label_from_exe(const char *exe, char **label); | |||
int label_mkdir(const char *path, mode_t mode); | int label_mkdir(const char *path, mode_t mode); | |||
void label_retest_selinux(void); | ||||
int label_bind(int fd, const struct sockaddr *addr, socklen_t addrlen); | int label_bind(int fd, const struct sockaddr *addr, socklen_t addrlen); | |||
int label_apply(const char *path, const char *label); | ||||
int label_write_one_line_file_atomic(const char *fn, const char *line); | int label_write_one_line_file_atomic(const char *fn, const char *line); | |||
int label_write_env_file(const char *fname, char **l); | int label_write_env_file(const char *fname, char **l); | |||
int label_fopen_temporary(const char *path, FILE **_f, char **_temp_path); | int label_fopen_temporary(const char *path, FILE **_f, char **_temp_path); | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
libudev-private.h | libudev-private.h | |||
---|---|---|---|---|
skipping to change at line 51 | skipping to change at line 51 | |||
udev_log(udev, prio, __FILE__, __LINE__, __FUNCTION__, ## arg); \ | udev_log(udev, prio, __FILE__, __LINE__, __FUNCTION__, ## arg); \ | |||
} while (0) | } while (0) | |||
#define udev_dbg(udev, arg...) udev_log_cond(udev, LOG_DEBUG, ## arg) | #define udev_dbg(udev, arg...) udev_log_cond(udev, LOG_DEBUG, ## arg) | |||
#define udev_info(udev, arg...) udev_log_cond(udev, LOG_INFO, ## arg) | #define udev_info(udev, arg...) udev_log_cond(udev, LOG_INFO, ## arg) | |||
#define udev_err(udev, arg...) udev_log_cond(udev, LOG_ERR, ## arg) | #define udev_err(udev, arg...) udev_log_cond(udev, LOG_ERR, ## arg) | |||
/* libudev.c */ | /* libudev.c */ | |||
void udev_log(struct udev *udev, | void udev_log(struct udev *udev, | |||
int priority, const char *file, int line, const char *fn, | int priority, const char *file, int line, const char *fn, | |||
const char *format, ...) | const char *format, ...) _printf_(6, 7); | |||
__attribute__((format(printf, 6, 7))); | ||||
int udev_get_rules_path(struct udev *udev, char **path[], usec_t *ts_usec[] ); | int udev_get_rules_path(struct udev *udev, char **path[], usec_t *ts_usec[] ); | |||
struct udev_list_entry *udev_add_property(struct udev *udev, const char *ke y, const char *value); | struct udev_list_entry *udev_add_property(struct udev *udev, const char *ke y, const char *value); | |||
struct udev_list_entry *udev_get_properties_list_entry(struct udev *udev); | struct udev_list_entry *udev_get_properties_list_entry(struct udev *udev); | |||
/* libudev-device.c */ | /* libudev-device.c */ | |||
struct udev_device *udev_device_new(struct udev *udev); | struct udev_device *udev_device_new(struct udev *udev); | |||
mode_t udev_device_get_devnode_mode(struct udev_device *udev_device); | mode_t udev_device_get_devnode_mode(struct udev_device *udev_device); | |||
uid_t udev_device_get_devnode_uid(struct udev_device *udev_device); | uid_t udev_device_get_devnode_uid(struct udev_device *udev_device); | |||
gid_t udev_device_get_devnode_gid(struct udev_device *udev_device); | gid_t udev_device_get_devnode_gid(struct udev_device *udev_device); | |||
int udev_device_set_subsystem(struct udev_device *udev_device, const char * subsystem); | int udev_device_set_subsystem(struct udev_device *udev_device, const char * subsystem); | |||
int udev_device_set_syspath(struct udev_device *udev_device, const char *sy spath); | int udev_device_set_syspath(struct udev_device *udev_device, const char *sy spath); | |||
int udev_device_set_devnode(struct udev_device *udev_device, const char *de vnode); | ||||
int udev_device_add_devlink(struct udev_device *udev_device, const char *de vlink); | int udev_device_add_devlink(struct udev_device *udev_device, const char *de vlink); | |||
void udev_device_cleanup_devlinks_list(struct udev_device *udev_device); | void udev_device_cleanup_devlinks_list(struct udev_device *udev_device); | |||
struct udev_list_entry *udev_device_add_property(struct udev_device *udev_d evice, const char *key, const char *value); | struct udev_list_entry *udev_device_add_property(struct udev_device *udev_d evice, const char *key, const char *value); | |||
void udev_device_add_property_from_string_parse(struct udev_device *udev_de vice, const char *property); | void udev_device_add_property_from_string_parse(struct udev_device *udev_de vice, const char *property); | |||
int udev_device_add_property_from_string_parse_finish(struct udev_device *u dev_device); | int udev_device_add_property_from_string_parse_finish(struct udev_device *u dev_device); | |||
char **udev_device_get_properties_envp(struct udev_device *udev_device); | char **udev_device_get_properties_envp(struct udev_device *udev_device); | |||
ssize_t udev_device_get_properties_monitor_buf(struct udev_device *udev_dev ice, const char **buf); | ssize_t udev_device_get_properties_monitor_buf(struct udev_device *udev_dev ice, const char **buf); | |||
int udev_device_read_db(struct udev_device *udev_device, const char *dbfile ); | int udev_device_read_db(struct udev_device *udev_device, const char *dbfile ); | |||
int udev_device_read_uevent_file(struct udev_device *udev_device); | int udev_device_read_uevent_file(struct udev_device *udev_device); | |||
int udev_device_set_action(struct udev_device *udev_device, const char *act ion); | int udev_device_set_action(struct udev_device *udev_device, const char *act ion); | |||
skipping to change at line 133 | skipping to change at line 131 | |||
node = (node)->next) | node = (node)->next) | |||
#define udev_list_node_foreach_safe(node, tmp, list) \ | #define udev_list_node_foreach_safe(node, tmp, list) \ | |||
for (node = (list)->next, tmp = (node)->next; \ | for (node = (list)->next, tmp = (node)->next; \ | |||
node != list; \ | node != list; \ | |||
node = tmp, tmp = (tmp)->next) | node = tmp, tmp = (tmp)->next) | |||
void udev_list_init(struct udev *udev, struct udev_list *list, bool unique) ; | void udev_list_init(struct udev *udev, struct udev_list *list, bool unique) ; | |||
void udev_list_cleanup(struct udev_list *list); | void udev_list_cleanup(struct udev_list *list); | |||
struct udev_list_entry *udev_list_get_entry(struct udev_list *list); | struct udev_list_entry *udev_list_get_entry(struct udev_list *list); | |||
struct udev_list_entry *udev_list_entry_add(struct udev_list *list, const c har *name, const char *value); | struct udev_list_entry *udev_list_entry_add(struct udev_list *list, const c har *name, const char *value); | |||
void udev_list_entry_delete(struct udev_list_entry *entry); | void udev_list_entry_delete(struct udev_list_entry *entry); | |||
void udev_list_entry_insert_before(struct udev_list_entry *new, struct udev | ||||
_list_entry *entry); | ||||
void udev_list_entry_append(struct udev_list_entry *new, struct udev_list * | ||||
list); | ||||
int udev_list_entry_get_num(struct udev_list_entry *list_entry); | int udev_list_entry_get_num(struct udev_list_entry *list_entry); | |||
void udev_list_entry_set_num(struct udev_list_entry *list_entry, int num); | void udev_list_entry_set_num(struct udev_list_entry *list_entry, int num); | |||
#define udev_list_entry_foreach_safe(entry, tmp, first) \ | #define udev_list_entry_foreach_safe(entry, tmp, first) \ | |||
for (entry = first, tmp = udev_list_entry_get_next(entry); \ | for (entry = first, tmp = udev_list_entry_get_next(entry); \ | |||
entry != NULL; \ | entry != NULL; \ | |||
entry = tmp, tmp = udev_list_entry_get_next(tmp)) | entry = tmp, tmp = udev_list_entry_get_next(tmp)) | |||
/* libudev-queue.c */ | /* libudev-queue.c */ | |||
unsigned long long int udev_get_kernel_seqnum(struct udev *udev); | unsigned long long int udev_get_kernel_seqnum(struct udev *udev); | |||
int udev_queue_read_seqnum(FILE *queue_file, unsigned long long int *seqnum ); | int udev_queue_read_seqnum(FILE *queue_file, unsigned long long int *seqnum ); | |||
skipping to change at line 178 | skipping to change at line 174 | |||
int util_replace_whitespace(const char *str, char *to, size_t len); | int util_replace_whitespace(const char *str, char *to, size_t len); | |||
int util_replace_chars(char *str, const char *white); | int util_replace_chars(char *str, const char *white); | |||
unsigned int util_string_hash32(const char *key); | unsigned int util_string_hash32(const char *key); | |||
uint64_t util_string_bloom64(const char *str); | uint64_t util_string_bloom64(const char *str); | |||
/* libudev-util-private.c */ | /* libudev-util-private.c */ | |||
int util_delete_path(struct udev *udev, const char *path); | int util_delete_path(struct udev *udev, const char *path); | |||
uid_t util_lookup_user(struct udev *udev, const char *user); | uid_t util_lookup_user(struct udev *udev, const char *user); | |||
gid_t util_lookup_group(struct udev *udev, const char *group); | gid_t util_lookup_group(struct udev *udev, const char *group); | |||
int util_resolve_subsys_kernel(struct udev *udev, const char *string, char *result, size_t maxsize, int read_value); | int util_resolve_subsys_kernel(struct udev *udev, const char *string, char *result, size_t maxsize, int read_value); | |||
ssize_t print_kmsg(const char *fmt, ...) __attribute__((format(printf, 1, 2 | ssize_t print_kmsg(const char *fmt, ...) _printf_(1, 2); | |||
))); | ||||
#endif | #endif | |||
End of changes. 4 change blocks. | ||||
9 lines changed or deleted | 3 lines changed or added | |||
libudev.h | libudev.h | |||
---|---|---|---|---|
skipping to change at line 173 | skipping to change at line 173 | |||
/* | /* | |||
* udev_queue | * udev_queue | |||
* | * | |||
* access to the currently running udev events | * access to the currently running udev events | |||
*/ | */ | |||
struct udev_queue; | struct udev_queue; | |||
struct udev_queue *udev_queue_ref(struct udev_queue *udev_queue); | struct udev_queue *udev_queue_ref(struct udev_queue *udev_queue); | |||
struct udev_queue *udev_queue_unref(struct udev_queue *udev_queue); | struct udev_queue *udev_queue_unref(struct udev_queue *udev_queue); | |||
struct udev *udev_queue_get_udev(struct udev_queue *udev_queue); | struct udev *udev_queue_get_udev(struct udev_queue *udev_queue); | |||
struct udev_queue *udev_queue_new(struct udev *udev); | struct udev_queue *udev_queue_new(struct udev *udev); | |||
unsigned long long int udev_queue_get_kernel_seqnum(struct udev_queue *udev | unsigned long long int udev_queue_get_kernel_seqnum(struct udev_queue *udev | |||
_queue); | _queue) __attribute__ ((deprecated)); | |||
unsigned long long int udev_queue_get_udev_seqnum(struct udev_queue *udev_q | unsigned long long int udev_queue_get_udev_seqnum(struct udev_queue *udev_q | |||
ueue); | ueue) __attribute__ ((deprecated)); | |||
int udev_queue_get_udev_is_active(struct udev_queue *udev_queue); | int udev_queue_get_udev_is_active(struct udev_queue *udev_queue); | |||
int udev_queue_get_queue_is_empty(struct udev_queue *udev_queue); | int udev_queue_get_queue_is_empty(struct udev_queue *udev_queue); | |||
int udev_queue_get_seqnum_is_finished(struct udev_queue *udev_queue, unsign ed long long int seqnum); | int udev_queue_get_seqnum_is_finished(struct udev_queue *udev_queue, unsign ed long long int seqnum) __attribute__ ((deprecated)); | |||
int udev_queue_get_seqnum_sequence_is_finished(struct udev_queue *udev_queu e, | int udev_queue_get_seqnum_sequence_is_finished(struct udev_queue *udev_queu e, | |||
unsigned long long int start | unsigned long long int start | |||
, unsigned long long int end); | , unsigned long long int end) __attribute__ ((deprecated)); | |||
struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue | int udev_queue_get_fd(struct udev_queue *udev_queue); | |||
*udev_queue); | int udev_queue_flush(struct udev_queue *udev_queue); | |||
struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue | ||||
*udev_queue) __attribute__ ((deprecated)); | ||||
/* | /* | |||
* udev_hwdb | * udev_hwdb | |||
* | * | |||
* access to the static hardware properties database | * access to the static hardware properties database | |||
*/ | */ | |||
struct udev_hwdb; | struct udev_hwdb; | |||
struct udev_hwdb *udev_hwdb_new(struct udev *udev); | struct udev_hwdb *udev_hwdb_new(struct udev *udev); | |||
struct udev_hwdb *udev_hwdb_ref(struct udev_hwdb *hwdb); | struct udev_hwdb *udev_hwdb_ref(struct udev_hwdb *hwdb); | |||
struct udev_hwdb *udev_hwdb_unref(struct udev_hwdb *hwdb); | struct udev_hwdb *udev_hwdb_unref(struct udev_hwdb *hwdb); | |||
End of changes. 3 change blocks. | ||||
9 lines changed or deleted | 11 lines changed or added | |||
list.h | list.h | |||
---|---|---|---|---|
skipping to change at line 34 | skipping to change at line 34 | |||
/* The head of the linked list. Use this in the structure that shall | /* The head of the linked list. Use this in the structure that shall | |||
* contain the head of the linked list */ | * contain the head of the linked list */ | |||
#define LIST_HEAD(t,name) \ | #define LIST_HEAD(t,name) \ | |||
t *name | t *name | |||
/* The pointers in the linked list's items. Use this in the item structure */ | /* The pointers in the linked list's items. Use this in the item structure */ | |||
#define LIST_FIELDS(t,name) \ | #define LIST_FIELDS(t,name) \ | |||
t *name##_next, *name##_prev | t *name##_next, *name##_prev | |||
/* Initialize the list's head */ | /* Initialize the list's head */ | |||
#define LIST_HEAD_INIT(t,head) \ | #define LIST_HEAD_INIT(head) \ | |||
do { \ | do { \ | |||
(head) = NULL; } \ | (head) = NULL; } \ | |||
while(false) | while(false) | |||
/* Initialize a list item */ | /* Initialize a list item */ | |||
#define LIST_INIT(t,name,item) \ | #define LIST_INIT(name,item) \ | |||
do { \ | do { \ | |||
t *_item = (item); \ | typeof(*(item)) *_item = (item); \ | |||
assert(_item); \ | assert(_item); \ | |||
_item->name##_prev = _item->name##_next = NULL; \ | _item->name##_prev = _item->name##_next = NULL; \ | |||
} while(false) | } while(false) | |||
/* Prepend an item to the list */ | /* Prepend an item to the list */ | |||
#define LIST_PREPEND(t,name,head,item) \ | #define LIST_PREPEND(name,head,item) \ | |||
do { \ | do { \ | |||
t **_head = &(head), *_item = (item); \ | typeof(*(head)) **_head = &(head), *_item = (item); \ | |||
assert(_item); \ | assert(_item); \ | |||
if ((_item->name##_next = *_head)) \ | if ((_item->name##_next = *_head)) \ | |||
_item->name##_next->name##_prev = _item; \ | _item->name##_next->name##_prev = _item; \ | |||
_item->name##_prev = NULL; \ | _item->name##_prev = NULL; \ | |||
*_head = _item; \ | *_head = _item; \ | |||
} while(false) | } while(false) | |||
/* Remove an item from the list */ | /* Remove an item from the list */ | |||
#define LIST_REMOVE(t,name,head,item) \ | #define LIST_REMOVE(name,head,item) \ | |||
do { \ | do { \ | |||
t **_head = &(head), *_item = (item); \ | typeof(*(head)) **_head = &(head), *_item = (item); \ | |||
assert(_item); \ | assert(_item); \ | |||
if (_item->name##_next) \ | if (_item->name##_next) \ | |||
_item->name##_next->name##_prev = _item->name##_pre v; \ | _item->name##_next->name##_prev = _item->name##_pre v; \ | |||
if (_item->name##_prev) \ | if (_item->name##_prev) \ | |||
_item->name##_prev->name##_next = _item->name##_nex t; \ | _item->name##_prev->name##_next = _item->name##_nex t; \ | |||
else { \ | else { \ | |||
assert(*_head == _item); \ | assert(*_head == _item); \ | |||
*_head = _item->name##_next; \ | *_head = _item->name##_next; \ | |||
} \ | } \ | |||
_item->name##_next = _item->name##_prev = NULL; \ | _item->name##_next = _item->name##_prev = NULL; \ | |||
} while(false) | } while(false) | |||
/* Find the head of the list */ | /* Find the head of the list */ | |||
#define LIST_FIND_HEAD(t,name,item,head) \ | #define LIST_FIND_HEAD(name,item,head) \ | |||
do { \ | do { \ | |||
t *_item = (item); \ | typeof(*(item)) *_item = (item); \ | |||
assert(_item); \ | if (!_item) \ | |||
while (_item->name##_prev) \ | (head) = NULL; \ | |||
_item = _item->name##_prev; \ | else { \ | |||
(head) = _item; \ | while (_item->name##_prev) \ | |||
_item = _item->name##_prev; \ | ||||
(head) = _item; \ | ||||
} \ | ||||
} while (false) | } while (false) | |||
/* Find the tail of the list */ | /* Find the tail of the list */ | |||
#define LIST_FIND_TAIL(t,name,item,tail) \ | #define LIST_FIND_TAIL(name,item,tail) \ | |||
do { \ | do { \ | |||
t *_item = (item); \ | typeof(*(item)) *_item = (item); \ | |||
assert(_item); \ | if (!_item) \ | |||
while (_item->name##_next) \ | (tail) = NULL; \ | |||
_item = _item->name##_next; \ | else { \ | |||
(tail) = _item; \ | while (_item->name##_next) \ | |||
_item = _item->name##_next; \ | ||||
(tail) = _item; \ | ||||
} \ | ||||
} while (false) | } while (false) | |||
/* Insert an item after another one (a = where, b = what) */ | /* Insert an item after another one (a = where, b = what) */ | |||
#define LIST_INSERT_AFTER(t,name,head,a,b) \ | #define LIST_INSERT_AFTER(name,head,a,b) \ | |||
do { \ | do { \ | |||
t **_head = &(head), *_a = (a), *_b = (b); \ | typeof(*(head)) **_head = &(head), *_a = (a), *_b = (b); \ | |||
assert(_b); \ | assert(_b); \ | |||
if (!_a) { \ | if (!_a) { \ | |||
if ((_b->name##_next = *_head)) \ | if ((_b->name##_next = *_head)) \ | |||
_b->name##_next->name##_prev = _b; \ | _b->name##_next->name##_prev = _b; \ | |||
_b->name##_prev = NULL; \ | _b->name##_prev = NULL; \ | |||
*_head = _b; \ | *_head = _b; \ | |||
} else { \ | } else { \ | |||
if ((_b->name##_next = _a->name##_next)) \ | if ((_b->name##_next = _a->name##_next)) \ | |||
_b->name##_next->name##_prev = _b; \ | _b->name##_next->name##_prev = _b; \ | |||
_b->name##_prev = _a; \ | _b->name##_prev = _a; \ | |||
End of changes. 13 change blocks. | ||||
21 lines changed or deleted | 27 lines changed or added | |||
load-fragment.h | load-fragment.h | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
***/ | ***/ | |||
#include "unit.h" | #include "unit.h" | |||
/* Read service data from .desktop file style configuration fragments */ | /* Read service data from .desktop file style configuration fragments */ | |||
int unit_load_fragment(Unit *u); | int unit_load_fragment(Unit *u); | |||
void unit_dump_config_items(FILE *f); | void unit_dump_config_items(FILE *f); | |||
int config_parse_warn_compat(const char *unit, const char *filename, unsign | int config_parse_warn_compat(const char *unit, const char *filename, unsign | |||
ed line, const char *section, const char *lvalue, int ltype, const char *rv | ed line, const char *section, unsigned section_line, const char *lvalue, in | |||
alue, void *data, void *userdata); | t ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_deps(const char *unit, const char *filename, unsigned | int config_parse_unit_deps(const char *unit, const char *filename, unsigned | |||
line, const char *section, const char *lvalue, int ltype, const char *rval | line, const char *section, unsigned section_line, const char *lvalue, int | |||
ue, void *data, void *userdata); | ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_string_printf(const char *unit, const char *filename, | int config_parse_unit_string_printf(const char *unit, const char *filename, | |||
unsigned line, const char *section, const char *lvalue, int ltype, const c | unsigned line, const char *section, unsigned section_line, const char *lva | |||
har *rvalue, void *data, void *userdata); | lue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_strv_printf(const char *unit, const char *filename, u | int config_parse_unit_strv_printf(const char *unit, const char *filename, u | |||
nsigned line, const char *section, const char *lvalue, int ltype, const cha | nsigned line, const char *section, unsigned section_line, const char *lvalu | |||
r *rvalue, void *data, void *userdata); | e, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_path_printf(const char *unit, const char *filename, u | int config_parse_unit_path_printf(const char *unit, const char *filename, u | |||
nsigned line, const char *section, const char *lvalue, int ltype, const cha | nsigned line, const char *section, unsigned section_line, const char *lvalu | |||
r *rvalue, void *data, void *userdata); | e, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_documentation(const char *unit, const char *filename, unsi | int config_parse_unit_path_strv_printf(const char *unit, const char *filena | |||
gned line, const char *section, const char *lvalue, int ltype, const char * | me, unsigned line, const char *section, unsigned section_line, const char * | |||
rvalue, void *data, void *userdata); | lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_socket_listen(const char *unit, const char *filename, unsi | int config_parse_documentation(const char *unit, const char *filename, unsi | |||
gned line, const char *section, const char *lvalue, int ltype, const char * | gned line, const char *section, unsigned section_line, const char *lvalue, | |||
rvalue, void *data, void *userdata); | int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_socket_bind(const char *unit, const char *filename, unsign | int config_parse_socket_listen(const char *unit, const char *filename, unsi | |||
ed line, const char *section, const char *lvalue, int ltype, const char *rv | gned line, const char *section, unsigned section_line, const char *lvalue, | |||
alue, void *data, void *userdata); | int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_exec_nice(const char *unit, const char *filename, unsigned | int config_parse_socket_bind(const char *unit, const char *filename, unsign | |||
line, const char *section, const char *lvalue, int ltype, const char *rval | ed line, const char *section, unsigned section_line, const char *lvalue, in | |||
ue, void *data, void *userdata); | t ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_exec_oom_score_adjust(const char *unit, const char *filena | int config_parse_exec_nice(const char *unit, const char *filename, unsigned | |||
me, unsigned line, const char *section, const char *lvalue, int ltype, cons | line, const char *section, unsigned section_line, const char *lvalue, int | |||
t char *rvalue, void *data, void *userdata); | ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_exec(const char *unit, const char *filename, unsigned line | int config_parse_exec_oom_score_adjust(const char *unit, const char *filena | |||
, const char *section, const char *lvalue, int ltype, const char *rvalue, v | me, unsigned line, const char *section, unsigned section_line, const char * | |||
oid *data, void *userdata); | lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_service_timeout(const char *unit, const char *filename, un | int config_parse_exec(const char *unit, const char *filename, unsigned line | |||
signed line, const char *section, const char *lvalue, int ltype, const char | , const char *section, unsigned section_line, const char *lvalue, int ltype | |||
*rvalue, void *data, void *userdata); | , const char *rvalue, void *data, void *userdata); | |||
int config_parse_service_type(const char *unit, const char *filename, unsig | int config_parse_service_timeout(const char *unit, const char *filename, un | |||
ned line, const char *section, const char *lvalue, int ltype, const char *r | signed line, const char *section, unsigned section_line, const char *lvalue | |||
value, void *data, void *userdata); | , int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_service_restart(const char *unit, const char *filename, un | int config_parse_service_type(const char *unit, const char *filename, unsig | |||
signed line, const char *section, const char *lvalue, int ltype, const char | ned line, const char *section, unsigned section_line, const char *lvalue, i | |||
*rvalue, void *data, void *userdata); | nt ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_socket_bindtodevice(const char *unit, const char *filename | int config_parse_service_restart(const char *unit, const char *filename, un | |||
, unsigned line, const char *section, const char *lvalue, int ltype, const | signed line, const char *section, unsigned section_line, const char *lvalue | |||
char *rvalue, void *data, void *userdata); | , int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_output(const char *unit, const char *filename, unsigned li | int config_parse_socket_bindtodevice(const char *unit, const char *filename | |||
ne, const char *section, const char *lvalue, int ltype, const char *rvalue, | , unsigned line, const char *section, unsigned section_line, const char *lv | |||
void *data, void *userdata); | alue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_input(const char *unit, const char *filename, unsigned lin | int config_parse_output(const char *unit, const char *filename, unsigned li | |||
e, const char *section, const char *lvalue, int ltype, const char *rvalue, | ne, const char *section, unsigned section_line, const char *lvalue, int lty | |||
void *data, void *userdata); | pe, const char *rvalue, void *data, void *userdata); | |||
int config_parse_exec_io_class(const char *unit, const char *filename, unsi | int config_parse_input(const char *unit, const char *filename, unsigned lin | |||
gned line, const char *section, const char *lvalue, int ltype, const char * | e, const char *section, unsigned section_line, const char *lvalue, int ltyp | |||
rvalue, void *data, void *userdata); | e, const char *rvalue, void *data, void *userdata); | |||
int config_parse_exec_io_priority(const char *unit, const char *filename, u | int config_parse_exec_io_class(const char *unit, const char *filename, unsi | |||
nsigned line, const char *section, const char *lvalue, int ltype, const cha | gned line, const char *section, unsigned section_line, const char *lvalue, | |||
r *rvalue, void *data, void *userdata); | int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_exec_cpu_sched_policy(const char *unit, const char *filena | int config_parse_exec_io_priority(const char *unit, const char *filename, u | |||
me, unsigned line, const char *section, const char *lvalue, int ltype, cons | nsigned line, const char *section, unsigned section_line, const char *lvalu | |||
t char *rvalue, void *data, void *userdata); | e, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_exec_cpu_sched_prio(const char *unit, const char *filename | int config_parse_exec_cpu_sched_policy(const char *unit, const char *filena | |||
, unsigned line, const char *section, const char *lvalue, int ltype, const | me, unsigned line, const char *section, unsigned section_line, const char * | |||
char *rvalue, void *data, void *userdata); | lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_exec_cpu_affinity(const char *unit, const char *filename, | int config_parse_exec_cpu_sched_prio(const char *unit, const char *filename | |||
unsigned line, const char *section, const char *lvalue, int ltype, const ch | , unsigned line, const char *section, unsigned section_line, const char *lv | |||
ar *rvalue, void *data, void *userdata); | alue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_exec_capabilities(const char *unit, const char *filename, | int config_parse_exec_cpu_affinity(const char *unit, const char *filename, | |||
unsigned line, const char *section, const char *lvalue, int ltype, const ch | unsigned line, const char *section, unsigned section_line, const char *lval | |||
ar *rvalue, void *data, void *userdata); | ue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_exec_secure_bits(const char *unit, const char *filename, u | int config_parse_exec_capabilities(const char *unit, const char *filename, | |||
nsigned line, const char *section, const char *lvalue, int ltype, const cha | unsigned line, const char *section, unsigned section_line, const char *lval | |||
r *rvalue, void *data, void *userdata); | ue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_bounding_set(const char *unit, const char *filename, unsig | int config_parse_exec_secure_bits(const char *unit, const char *filename, u | |||
ned line, const char *section, const char *lvalue, int ltype, const char *r | nsigned line, const char *section, unsigned section_line, const char *lvalu | |||
value, void *data, void *userdata); | e, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_limit(const char *unit, const char *filename, unsigned lin | int config_parse_bounding_set(const char *unit, const char *filename, unsig | |||
e, const char *section, const char *lvalue, int ltype, const char *rvalue, | ned line, const char *section, unsigned section_line, const char *lvalue, i | |||
void *data, void *userdata); | nt ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_sysv_priority(const char *unit, const char *filename, unsi | int config_parse_limit(const char *unit, const char *filename, unsigned lin | |||
gned line, const char *section, const char *lvalue, int ltype, const char * | e, const char *section, unsigned section_line, const char *lvalue, int ltyp | |||
rvalue, void *data, void *userdata); | e, const char *rvalue, void *data, void *userdata); | |||
int config_parse_fsck_passno(const char *unit, const char *filename, unsign | int config_parse_sysv_priority(const char *unit, const char *filename, unsi | |||
ed line, const char *section, const char *lvalue, int ltype, const char *rv | gned line, const char *section, unsigned section_line, const char *lvalue, | |||
alue, void *data, void *userdata); | int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_kill_signal(const char *unit, const char *filename, unsign | 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 | ed line, const char *section, unsigned section_line, const char *lvalue, in | |||
alue, void *data, void *userdata); | t ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_exec_mount_flags(const char *unit, const char *filename, u | 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 | nsigned line, const char *section, unsigned section_line, const char *lvalu | |||
r *rvalue, void *data, void *userdata); | e, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_timer(const char *unit, const char *filename, unsigned lin | int config_parse_timer(const char *unit, const char *filename, unsigned lin | |||
e, const char *section, const char *lvalue, int ltype, const char *rvalue, | e, const char *section, unsigned section_line, const char *lvalue, int ltyp | |||
void *data, void *userdata); | e, const char *rvalue, void *data, void *userdata); | |||
int config_parse_trigger_unit(const char *unit, const char *filename, unsig | 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 | ned line, const char *section, unsigned section_line, const char *lvalue, i | |||
value, void *data, void *userdata); | nt ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_path_spec(const char *unit, const char *filename, unsigned | int config_parse_path_spec(const char *unit, const char *filename, unsigned | |||
line, const char *section, const char *lvalue, int ltype, const char *rval | line, const char *section, unsigned section_line, const char *lvalue, int | |||
ue, void *data, void *userdata); | ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_socket_service(const char *unit, const char *filename, uns | int config_parse_socket_service(const char *unit, const char *filename, uns | |||
igned line, const char *section, const char *lvalue, int ltype, const char | igned line, const char *section, unsigned section_line, const char *lvalue, | |||
*rvalue, void *data, void *userdata); | int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_service_sockets(const char *unit, const char *filename, un | int config_parse_service_sockets(const char *unit, const char *filename, un | |||
signed line, const char *section, const char *lvalue, int ltype, const char | signed line, const char *section, unsigned section_line, const char *lvalue | |||
*rvalue, void *data, void *userdata); | , int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_env_file(const char *unit, const char *filename, unsi | int config_parse_busname_service(const char *unit, const char *filename, un | |||
gned line, const char *section, const char *lvalue, int ltype, const char * | signed line, const char *section, unsigned section_line, const char *lvalue | |||
rvalue, void *data, void *userdata); | , int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_ip_tos(const char *unit, const char *filename, unsigned li | int config_parse_bus_policy(const char *unit, const char *filename, unsigne | |||
ne, const char *section, const char *lvalue, int ltype, const char *rvalue, | d line, const char *section, unsigned section_line, const char *lvalue, int | |||
void *data, void *userdata); | ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_condition_path(const char *unit, const char *filename | int config_parse_bus_policy_world(const char *unit, const char *filename, u | |||
, unsigned line, const char *section, const char *lvalue, int ltype, const | nsigned line, const char *section, unsigned section_line, const char *lvalu | |||
char *rvalue, void *data, void *userdata); | e, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_condition_string(const char *unit, const char *filena | int config_parse_unit_env_file(const char *unit, const char *filename, unsi | |||
me, unsigned line, const char *section, const char *lvalue, int ltype, cons | gned line, const char *section, unsigned section_line, const char *lvalue, | |||
t char *rvalue, void *data, void *userdata); | int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_condition_null(const char *unit, const char *filename | int config_parse_ip_tos(const char *unit, const char *filename, unsigned li | |||
, unsigned line, const char *section, const char *lvalue, int ltype, const | ne, const char *section, unsigned section_line, const char *lvalue, int lty | |||
char *rvalue, void *data, void *userdata); | pe, const char *rvalue, void *data, void *userdata); | |||
int config_parse_kill_mode(const char *unit, const char *filename, unsigned | int config_parse_unit_condition_path(const char *unit, const char *filename | |||
line, const char *section, const char *lvalue, int ltype, const char *rval | , unsigned line, const char *section, unsigned section_line, const char *lv | |||
ue, void *data, void *userdata); | alue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_notify_access(const char *unit, const char *filename, unsi | int config_parse_unit_condition_string(const char *unit, const char *filena | |||
gned line, const char *section, const char *lvalue, int ltype, const char * | me, unsigned line, const char *section, unsigned section_line, const char * | |||
rvalue, void *data, void *userdata); | lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_start_limit_action(const char *unit, const char *filename, | int config_parse_unit_condition_null(const char *unit, const char *filename | |||
unsigned line, const char *section, const char *lvalue, int ltype, const c | , unsigned line, const char *section, unsigned section_line, const char *lv | |||
har *rvalue, void *data, void *userdata); | alue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_requires_mounts_for(const char *unit, const char *fil | int config_parse_kill_mode(const char *unit, const char *filename, unsigned | |||
ename, unsigned line, const char *section, const char *lvalue, int ltype, c | line, const char *section, unsigned section_line, const char *lvalue, int | |||
onst char *rvalue, void *data, void *userdata); | ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_syscall_filter(const char *unit, const char *filename, uns | int config_parse_notify_access(const char *unit, const char *filename, unsi | |||
igned line, const char *section, const char *lvalue, int ltype, const char | gned line, const char *section, unsigned section_line, const char *lvalue, | |||
*rvalue, void *data, void *userdata); | int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_environ(const char *unit, const char *filename, unsigned l | int config_parse_failure_action(const char *unit, const char *filename, uns | |||
ine, const char *section, const char *lvalue, int ltype, const char *rvalue | igned line, const char *section, unsigned section_line, const char *lvalue, | |||
, void *data, void *userdata); | int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_slice(const char *unit, const char *filename, unsigne | int config_parse_unit_requires_mounts_for(const char *unit, const char *fil | |||
d line, const char *section, const char *lvalue, int ltype, const char *rva | ename, unsigned line, const char *section, unsigned section_line, const cha | |||
lue, void *data, void *userdata); | r *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_cpu_shares(const char *unit, const char *filename, unsigne | int config_parse_syscall_filter(const char *unit, const char *filename, uns | |||
d line, const char *section, const char *lvalue, int ltype, const char *rva | igned line, const char *section, unsigned section_line, const char *lvalue, | |||
lue, void *data, void *userdata); | int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_memory_limit(const char *unit, const char *filename, unsig | int config_parse_syscall_archs(const char *unit, const char *filename, unsi | |||
ned line, const char *section, const char *lvalue, int ltype, const char *r | gned line, const char *section, unsigned section_line, const char *lvalue, | |||
value, void *data, void *userdata); | int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_device_policy(const char *unit, const char *filename, unsi | int config_parse_syscall_errno(const char *unit, const char *filename, unsi | |||
gned line, const char *section, const char *lvalue, int ltype, const char * | gned line, const char *section, unsigned section_line, const char *lvalue, | |||
rvalue, void *data, void *userdata); | int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_device_allow(const char *unit, const char *filename, unsig | int config_parse_environ(const char *unit, const char *filename, unsigned l | |||
ned line, const char *section, const char *lvalue, int ltype, const char *r | ine, const char *section, unsigned section_line, const char *lvalue, int lt | |||
value, void *data, void *userdata); | ype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_blockio_weight(const char *unit, const char *filename, uns | int config_parse_unit_slice(const char *unit, const char *filename, unsigne | |||
igned line, const char *section, const char *lvalue, int ltype, const char | d line, const char *section, unsigned section_line, const char *lvalue, int | |||
*rvalue, void *data, void *userdata); | ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_blockio_device_weight(const char *unit, const char *filena | int config_parse_cpu_shares(const char *unit, const char *filename, unsigne | |||
me, unsigned line, const char *section, const char *lvalue, int ltype, cons | d line, const char *section, unsigned section_line, const char *lvalue, int | |||
t char *rvalue, void *data, void *userdata); | ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_blockio_bandwidth(const char *unit, const char *filename, | int config_parse_memory_limit(const char *unit, const char *filename, unsig | |||
unsigned line, const char *section, const char *lvalue, int ltype, const ch | ned line, const char *section, unsigned section_line, const char *lvalue, i | |||
ar *rvalue, void *data, void *userdata); | nt ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_device_policy(const char *unit, const char *filename, unsi | ||||
gned line, const char *section, unsigned section_line, 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, unsigned section_line, const char *lvalue, i | ||||
nt ltype, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_blockio_weight(const char *unit, const char *filename, uns | ||||
igned line, const char *section, unsigned section_line, const char *lvalue, | ||||
int ltype, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_blockio_device_weight(const char *unit, const char *filena | ||||
me, unsigned line, const char *section, unsigned section_line, 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, unsigned section_line, const char *lval | ||||
ue, int ltype, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_job_mode(const char *unit, const char *filename, unsigned | ||||
line, const char *section, unsigned section_line, const char *lvalue, int l | ||||
type, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_job_mode_isolate(const char *unit, const char *filename, u | ||||
nsigned line, const char *section, unsigned section_line, const char *lvalu | ||||
e, int ltype, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_exec_selinux_context(const char *unit, const char *filenam | ||||
e, unsigned line, const char *section, unsigned section_line, const char *l | ||||
value, int ltype, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_personality(const char *unit, const char *filename, unsign | ||||
ed line, const char *section, unsigned section_line, const char *lvalue, in | ||||
t ltype, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_exec_apparmor_profile(const char *unit, const char *filena | ||||
me, unsigned line, const char *section, unsigned section_line, const char * | ||||
lvalue, int ltype, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_address_families(const char *unit, const char *filename, u | ||||
nsigned line, const char *section, unsigned section_line, const char *lvalu | ||||
e, int ltype, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_runtime_directory(const char *unit, const char *filename, | ||||
unsigned line, const char *section, unsigned section_line, const char *lval | ||||
ue, int ltype, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_set_status(const char *unit, const char *filename, unsigne | ||||
d line, const char *section, unsigned section_line, const char *lvalue, int | ||||
ltype, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_namespace_path_strv(const char *unit, const char *filename | ||||
, unsigned line, const char *section, unsigned section_line, const char *lv | ||||
alue, int ltype, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_no_new_privileges(const char *unit, const char *filename, | ||||
unsigned line, const char *section, unsigned section_line, const char *lval | ||||
ue, int ltype, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_cpu_quota(const char *unit, const char *filename, unsigned | ||||
line, const char *section, unsigned section_line, const char *lvalue, int | ||||
ltype, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_protect_home(const char* unit, const char *filename, unsig | ||||
ned line, const char *section, unsigned section_line, const char *lvalue, i | ||||
nt ltype, const char *rvalue, void *data, void *userdata); | ||||
int config_parse_protect_system(const char* unit, const char *filename, uns | ||||
igned line, const char *section, unsigned section_line, const char *lvalue, | ||||
int ltype, const char *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. 1 change blocks. | ||||
162 lines changed or deleted | 216 lines changed or added | |||
log.h | log.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <syslog.h> | ||||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <stdarg.h> | #include <stdarg.h> | |||
#include <syslog.h> | ||||
#include <sys/signalfd.h> | ||||
#include <errno.h> | #include <errno.h> | |||
#include "macro.h" | #include "macro.h" | |||
#include "sd-id128.h" | #include "sd-id128.h" | |||
typedef enum LogTarget{ | typedef enum LogTarget{ | |||
LOG_TARGET_CONSOLE, | LOG_TARGET_CONSOLE, | |||
LOG_TARGET_KMSG, | LOG_TARGET_KMSG, | |||
LOG_TARGET_JOURNAL, | LOG_TARGET_JOURNAL, | |||
LOG_TARGET_JOURNAL_OR_KMSG, | LOG_TARGET_JOURNAL_OR_KMSG, | |||
skipping to change at line 54 | skipping to change at line 55 | |||
} LogTarget; | } LogTarget; | |||
void log_set_target(LogTarget target); | void log_set_target(LogTarget target); | |||
void log_set_max_level(int level); | void log_set_max_level(int level); | |||
void log_set_facility(int facility); | void log_set_facility(int facility); | |||
int log_set_target_from_string(const char *e); | int log_set_target_from_string(const char *e); | |||
int log_set_max_level_from_string(const char *e); | int log_set_max_level_from_string(const char *e); | |||
void log_show_color(bool b); | void log_show_color(bool b); | |||
bool log_get_show_color(void) _pure_; | ||||
void log_show_location(bool b); | void log_show_location(bool b); | |||
bool log_get_show_location(void) _pure_; | ||||
int log_show_color_from_string(const char *e); | int log_show_color_from_string(const char *e); | |||
int log_show_location_from_string(const char *e); | int log_show_location_from_string(const char *e); | |||
LogTarget log_get_target(void) _pure_; | LogTarget log_get_target(void) _pure_; | |||
int log_get_max_level(void) _pure_; | int log_get_max_level(void) _pure_; | |||
int log_open(void); | int log_open(void); | |||
void log_close(void); | void log_close(void); | |||
void log_forget_fds(void); | void log_forget_fds(void); | |||
skipping to change at line 78 | skipping to change at line 81 | |||
void log_close_kmsg(void); | void log_close_kmsg(void); | |||
void log_close_console(void); | void log_close_console(void); | |||
void log_parse_environment(void); | void log_parse_environment(void); | |||
int log_meta( | int log_meta( | |||
int level, | int level, | |||
const char*file, | const char*file, | |||
int line, | int line, | |||
const char *func, | const char *func, | |||
const char *format, ...) _printf_attr_(5,6); | const char *format, ...) _printf_(5,6); | |||
int log_metav( | int log_metav( | |||
int level, | int level, | |||
const char*file, | const char*file, | |||
int line, | int line, | |||
const char *func, | const char *func, | |||
const char *format, | const char *format, | |||
va_list ap) _printf_attr_(5,0); | va_list ap) _printf_(5,0); | |||
int log_meta_object( | int log_meta_object( | |||
int level, | int level, | |||
const char*file, | const char*file, | |||
int line, | int line, | |||
const char *func, | const char *func, | |||
const char *object_name, | const char *object_name, | |||
const char *object, | const char *object, | |||
const char *format, ...) _printf_attr_(7,8); | const char *format, ...) _printf_(7,8); | |||
int log_metav_object( | int log_metav_object( | |||
int level, | int level, | |||
const char*file, | const char*file, | |||
int line, | int line, | |||
const char *func, | const char *func, | |||
const char *object_name, | const char *object_name, | |||
const char *object, | const char *object, | |||
const char *format, | const char *format, | |||
va_list ap) _printf_attr_(7,0); | va_list ap) _printf_(7,0); | |||
int log_struct_internal( | int log_struct_internal( | |||
int level, | int level, | |||
const char *file, | const char *file, | |||
int line, | int line, | |||
const char *func, | const char *func, | |||
const char *format, ...) _printf_attr_(5,0) _sentinel_; | const char *format, ...) _printf_(5,0) _sentinel_; | |||
int log_oom_internal( | int log_oom_internal( | |||
const char *file, | const char *file, | |||
int line, | int line, | |||
const char *func); | const char *func); | |||
/* This modifies the buffer passed! */ | /* This modifies the buffer passed! */ | |||
int log_dump_internal( | int log_dump_internal( | |||
int level, | int level, | |||
const char*file, | const char*file, | |||
int line, | int line, | |||
const char *func, | const char *func, | |||
char *buffer); | char *buffer); | |||
_noreturn_ void log_assert_failed( | noreturn void log_assert_failed( | |||
const char *text, | const char *text, | |||
const char *file, | const char *file, | |||
int line, | int line, | |||
const char *func); | const char *func); | |||
_noreturn_ void log_assert_failed_unreachable( | noreturn void log_assert_failed_unreachable( | |||
const char *text, | const char *text, | |||
const char *file, | const char *file, | |||
int line, | int line, | |||
const char *func); | const char *func); | |||
#define log_full(level, ...) log_meta(level, __FILE__, __LINE__, __func__ | void log_assert_failed_return( | |||
, __VA_ARGS__) | const char *text, | |||
const char *file, | ||||
int line, | ||||
const char *func); | ||||
#define log_debug(...) log_meta(LOG_DEBUG, __FILE__, __LINE__, __func__ | #define log_full(level, ...) \ | |||
, __VA_ARGS__) | do { \ | |||
#define log_info(...) log_meta(LOG_INFO, __FILE__, __LINE__, __func__ | if (log_get_max_level() >= (level)) \ | |||
, __VA_ARGS__) | log_meta((level), __FILE__, __LINE__, __func__, __VA_ARGS__ | |||
#define log_notice(...) log_meta(LOG_NOTICE, __FILE__, __LINE__, __func__ | ); \ | |||
, __VA_ARGS__) | } while (0) | |||
#define log_warning(...) log_meta(LOG_WARNING, __FILE__, __LINE__, __func__ | ||||
, __VA_ARGS__) | #define log_debug(...) log_full(LOG_DEBUG, __VA_ARGS__) | |||
#define log_error(...) log_meta(LOG_ERR, __FILE__, __LINE__, __func__ | #define log_info(...) log_full(LOG_INFO, __VA_ARGS__) | |||
, __VA_ARGS__) | #define log_notice(...) log_full(LOG_NOTICE, __VA_ARGS__) | |||
#define log_warning(...) log_full(LOG_WARNING, __VA_ARGS__) | ||||
#define log_error(...) log_full(LOG_ERR, __VA_ARGS__) | ||||
#define log_struct(level, ...) log_struct_internal(level, __FILE__, __LINE_ _, __func__, __VA_ARGS__) | #define log_struct(level, ...) log_struct_internal(level, __FILE__, __LINE_ _, __func__, __VA_ARGS__) | |||
#define log_oom() log_oom_internal(__FILE__, __LINE__, __func__) | #define log_oom() log_oom_internal(__FILE__, __LINE__, __func__) | |||
/* This modifies the buffer passed! */ | /* This modifies the buffer passed! */ | |||
#define log_dump(level, buffer) log_dump_internal(level, __FILE__, __LINE__ , __func__, buffer) | #define log_dump(level, buffer) log_dump_internal(level, __FILE__, __LINE__ , __func__, buffer) | |||
bool log_on_console(void) _pure_; | bool log_on_console(void) _pure_; | |||
const char *log_target_to_string(LogTarget target) _const_; | const char *log_target_to_string(LogTarget target) _const_; | |||
LogTarget log_target_from_string(const char *s) _pure_; | LogTarget log_target_from_string(const char *s) _pure_; | |||
#define MESSAGE_ID(x) "MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VA L(x) | #define MESSAGE_ID(x) "MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VA L(x) | |||
void log_received_signal(int level, const struct signalfd_siginfo *si); | ||||
End of changes. 14 change blocks. | ||||
20 lines changed or deleted | 28 lines changed or added | |||
logind-action.h | logind-action.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foologindactionhfoo | #pragma once | |||
#define foologindactionhfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2012 Lennart Poettering | Copyright 2012 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. | |||
skipping to change at line 52 | skipping to change at line 51 | |||
int manager_handle_action( | int manager_handle_action( | |||
Manager *m, | Manager *m, | |||
InhibitWhat inhibit_key, | InhibitWhat inhibit_key, | |||
HandleAction handle, | HandleAction handle, | |||
bool ignore_inhibited, | bool ignore_inhibited, | |||
bool is_edge); | bool is_edge); | |||
const char* handle_action_to_string(HandleAction h) _const_; | const char* handle_action_to_string(HandleAction h) _const_; | |||
HandleAction handle_action_from_string(const char *s) _pure_; | HandleAction handle_action_from_string(const char *s) _pure_; | |||
int config_parse_handle_action(const char *unit, const char *filename, unsi | int config_parse_handle_action(const char *unit, const char *filename, unsi | |||
gned line, const char *section, const char *lvalue, int ltype, const char * | gned line, const char *section, unsigned section_line, const char *lvalue, | |||
rvalue, void *data, void *userdata); | int ltype, const char *rvalue, void *data, void *userdata); | |||
#endif | ||||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added | |||
logind-button.h | logind-button.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foologindbuttonhfoo | #pragma once | |||
#define foologindbuttonhfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2012 Lennart Poettering | Copyright 2012 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. | |||
skipping to change at line 34 | skipping to change at line 33 | |||
typedef struct Button Button; | typedef struct Button Button; | |||
#include "list.h" | #include "list.h" | |||
#include "util.h" | #include "util.h" | |||
#include "logind.h" | #include "logind.h" | |||
struct Button { | struct Button { | |||
Manager *manager; | Manager *manager; | |||
sd_event_source *io_event_source; | ||||
sd_event_source *check_event_source; | ||||
char *name; | char *name; | |||
char *seat; | char *seat; | |||
int fd; | int fd; | |||
bool lid_close_queued; | bool lid_closed; | |||
bool docked; | ||||
}; | }; | |||
Button* button_new(Manager *m, const char *name); | Button* button_new(Manager *m, const char *name); | |||
void button_free(Button*b); | void button_free(Button*b); | |||
int button_open(Button *b); | int button_open(Button *b); | |||
int button_process(Button *b); | ||||
int button_recheck(Button *b); | ||||
int button_set_seat(Button *b, const char *sn); | int button_set_seat(Button *b, const char *sn); | |||
int button_check_switches(Button *b); | ||||
#endif | ||||
End of changes. 5 change blocks. | ||||
5 lines changed or deleted | 6 lines changed or added | |||
logind-device.h | logind-device.h | |||
---|---|---|---|---|
skipping to change at line 48 | skipping to change at line 48 | |||
dual_timestamp timestamp; | dual_timestamp timestamp; | |||
LIST_FIELDS(struct Device, devices); | LIST_FIELDS(struct Device, devices); | |||
LIST_HEAD(SessionDevice, session_devices); | LIST_HEAD(SessionDevice, session_devices); | |||
}; | }; | |||
Device* device_new(Manager *m, const char *sysfs, bool master); | Device* device_new(Manager *m, const char *sysfs, bool master); | |||
void device_free(Device *d); | void device_free(Device *d); | |||
void device_attach(Device *d, Seat *s); | void device_attach(Device *d, Seat *s); | |||
void device_detach(Device *d); | ||||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
logind-inhibit.h | logind-inhibit.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foologindinhibithfoo | #pragma once | |||
#define foologindinhibithfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2012 Lennart Poettering | Copyright 2012 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. | |||
skipping to change at line 55 | skipping to change at line 54 | |||
_INHIBIT_MODE_MAX, | _INHIBIT_MODE_MAX, | |||
_INHIBIT_MODE_INVALID = -1 | _INHIBIT_MODE_INVALID = -1 | |||
} InhibitMode; | } InhibitMode; | |||
#include "logind.h" | #include "logind.h" | |||
#include "logind-seat.h" | #include "logind-seat.h" | |||
struct Inhibitor { | struct Inhibitor { | |||
Manager *manager; | Manager *manager; | |||
sd_event_source *event_source; | ||||
char *id; | char *id; | |||
char *state_file; | char *state_file; | |||
bool started; | bool started; | |||
InhibitWhat what; | InhibitWhat what; | |||
char *who; | char *who; | |||
char *why; | char *why; | |||
InhibitMode mode; | InhibitMode mode; | |||
skipping to change at line 87 | skipping to change at line 88 | |||
int inhibitor_save(Inhibitor *i); | int inhibitor_save(Inhibitor *i); | |||
int inhibitor_load(Inhibitor *i); | int inhibitor_load(Inhibitor *i); | |||
int inhibitor_start(Inhibitor *i); | int inhibitor_start(Inhibitor *i); | |||
int inhibitor_stop(Inhibitor *i); | int inhibitor_stop(Inhibitor *i); | |||
int inhibitor_create_fifo(Inhibitor *i); | int inhibitor_create_fifo(Inhibitor *i); | |||
void inhibitor_remove_fifo(Inhibitor *i); | void inhibitor_remove_fifo(Inhibitor *i); | |||
InhibitWhat manager_inhibit_what(Manager *m, InhibitMode mm); | InhibitWhat manager_inhibit_what(Manager *m, InhibitMode mm); | |||
bool manager_is_inhibited(Manager *m, InhibitWhat w, InhibitMode mm, dual_t imestamp *since, bool ignore_inactive, bool ignore_uid, uid_t uid); | bool manager_is_inhibited(Manager *m, InhibitWhat w, InhibitMode mm, dual_t imestamp *since, bool ignore_inactive, bool ignore_uid, uid_t uid, Inhibito r **offending); | |||
const char *inhibit_what_to_string(InhibitWhat k); | const char *inhibit_what_to_string(InhibitWhat k); | |||
InhibitWhat inhibit_what_from_string(const char *s); | InhibitWhat inhibit_what_from_string(const char *s); | |||
const char *inhibit_mode_to_string(InhibitMode k); | const char *inhibit_mode_to_string(InhibitMode k); | |||
InhibitMode inhibit_mode_from_string(const char *s); | InhibitMode inhibit_mode_from_string(const char *s); | |||
#endif | ||||
End of changes. 4 change blocks. | ||||
3 lines changed or deleted | 4 lines changed or added | |||
logind-seat.h | logind-seat.h | |||
---|---|---|---|---|
skipping to change at line 44 | skipping to change at line 44 | |||
char *id; | char *id; | |||
char *state_file; | char *state_file; | |||
LIST_HEAD(Device, devices); | LIST_HEAD(Device, devices); | |||
Session *active; | Session *active; | |||
Session *pending_switch; | Session *pending_switch; | |||
LIST_HEAD(Session, sessions); | LIST_HEAD(Session, sessions); | |||
Session **positions; | ||||
size_t position_count; | ||||
bool in_gc_queue:1; | bool in_gc_queue:1; | |||
bool started:1; | bool started:1; | |||
LIST_FIELDS(Seat, gc_queue); | LIST_FIELDS(Seat, gc_queue); | |||
}; | }; | |||
Seat *seat_new(Manager *m, const char *id); | Seat *seat_new(Manager *m, const char *id); | |||
void seat_free(Seat *s); | void seat_free(Seat *s); | |||
int seat_save(Seat *s); | int seat_save(Seat *s); | |||
int seat_load(Seat *s); | int seat_load(Seat *s); | |||
int seat_apply_acls(Seat *s, Session *old_active); | int seat_apply_acls(Seat *s, Session *old_active); | |||
int seat_set_active(Seat *s, Session *session); | int seat_set_active(Seat *s, Session *session); | |||
int seat_active_vt_changed(Seat *s, int vtnr); | int seat_switch_to(Seat *s, unsigned int num); | |||
int seat_switch_to_next(Seat *s); | ||||
int seat_switch_to_previous(Seat *s); | ||||
int seat_active_vt_changed(Seat *s, unsigned int vtnr); | ||||
int seat_read_active_vt(Seat *s); | int seat_read_active_vt(Seat *s); | |||
int seat_preallocate_vts(Seat *s); | int seat_preallocate_vts(Seat *s); | |||
int seat_attach_session(Seat *s, Session *session); | int seat_attach_session(Seat *s, Session *session); | |||
void seat_complete_switch(Seat *s); | void seat_complete_switch(Seat *s); | |||
void seat_evict_position(Seat *s, Session *session); | ||||
void seat_claim_position(Seat *s, Session *session, unsigned int pos); | ||||
bool seat_has_vts(Seat *s); | bool seat_has_vts(Seat *s); | |||
bool seat_is_seat0(Seat *s); | bool seat_is_seat0(Seat *s); | |||
bool seat_can_multi_session(Seat *s); | bool seat_can_multi_session(Seat *s); | |||
bool seat_can_tty(Seat *s); | bool seat_can_tty(Seat *s); | |||
bool seat_has_master_device(Seat *s); | bool seat_has_master_device(Seat *s); | |||
bool seat_can_graphical(Seat *s); | bool seat_can_graphical(Seat *s); | |||
int seat_get_idle_hint(Seat *s, dual_timestamp *t); | int seat_get_idle_hint(Seat *s, dual_timestamp *t); | |||
int seat_start(Seat *s); | int seat_start(Seat *s); | |||
int seat_stop(Seat *s); | int seat_stop(Seat *s, bool force); | |||
int seat_stop_sessions(Seat *s); | int seat_stop_sessions(Seat *s, bool force); | |||
int seat_check_gc(Seat *s, bool drop_not_started); | bool seat_check_gc(Seat *s, bool drop_not_started); | |||
void seat_add_to_gc_queue(Seat *s); | void seat_add_to_gc_queue(Seat *s); | |||
bool seat_name_is_valid(const char *name); | bool seat_name_is_valid(const char *name); | |||
char *seat_bus_path(Seat *s); | ||||
extern const DBusObjectPathVTable bus_seat_vtable; | extern const sd_bus_vtable seat_vtable[]; | |||
int seat_node_enumerator(sd_bus *bus, const char *path, void *userdata, cha | ||||
r ***nodes, sd_bus_error *error); | ||||
int seat_object_find(sd_bus *bus, const char *path, const char *interface, | ||||
void *userdata, void **found, sd_bus_error *error); | ||||
char *seat_bus_path(Seat *s); | ||||
int seat_send_signal(Seat *s, bool new_seat); | int seat_send_signal(Seat *s, bool new_seat); | |||
int seat_send_changed(Seat *s, const char *properties); | int seat_send_changed(Seat *s, const char *properties, ...) _sentinel_; | |||
End of changes. 8 change blocks. | ||||
6 lines changed or deleted | 19 lines changed or added | |||
logind-session.h | logind-session.h | |||
---|---|---|---|---|
skipping to change at line 57 | skipping to change at line 57 | |||
SESSION_LOCK_SCREEN, | SESSION_LOCK_SCREEN, | |||
SESSION_BACKGROUND, | SESSION_BACKGROUND, | |||
_SESSION_CLASS_MAX, | _SESSION_CLASS_MAX, | |||
_SESSION_CLASS_INVALID = -1 | _SESSION_CLASS_INVALID = -1 | |||
} SessionClass; | } SessionClass; | |||
typedef enum SessionType { | typedef enum SessionType { | |||
SESSION_UNSPECIFIED, | SESSION_UNSPECIFIED, | |||
SESSION_TTY, | SESSION_TTY, | |||
SESSION_X11, | SESSION_X11, | |||
SESSION_WAYLAND, | ||||
SESSION_MIR, | ||||
_SESSION_TYPE_MAX, | _SESSION_TYPE_MAX, | |||
_SESSION_TYPE_INVALID = -1 | _SESSION_TYPE_INVALID = -1 | |||
} SessionType; | } SessionType; | |||
#define SESSION_TYPE_IS_GRAPHICAL(type) IN_SET(type, SESSION_X11, SESSION_W | ||||
AYLAND, SESSION_MIR) | ||||
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 | |||
}; | }; | |||
struct Session { | struct Session { | |||
Manager *manager; | Manager *manager; | |||
char *id; | char *id; | |||
unsigned int pos; | ||||
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 *desktop; | ||||
char *scope; | char *scope; | |||
char *scope_job; | char *scope_job; | |||
int vtnr; | ||||
Seat *seat; | Seat *seat; | |||
unsigned int vtnr; | ||||
int vtfd; | ||||
sd_event_source *vt_source; | ||||
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; | |||
sd_event_source *fifo_event_source; | ||||
bool idle_hint; | bool idle_hint; | |||
dual_timestamp idle_hint_timestamp; | dual_timestamp idle_hint_timestamp; | |||
bool in_gc_queue:1; | bool in_gc_queue:1; | |||
bool started:1; | bool started:1; | |||
bool closing:1; | bool stopping:1; | |||
DBusMessage *create_message; | sd_bus_message *create_message; | |||
sd_event_source *timer_event_source; | ||||
char *controller; | char *controller; | |||
Hashmap *devices; | Hashmap *devices; | |||
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, 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); | void session_set_user(Session *s, User *u); | |||
int session_check_gc(Session *s, bool drop_not_started); | bool 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); | ||||
int session_start(Session *s); | int session_start(Session *s); | |||
int session_stop(Session *s); | int session_stop(Session *s, bool force); | |||
int session_finalize(Session *s); | int session_finalize(Session *s); | |||
void session_release(Session *s); | ||||
int session_save(Session *s); | int session_save(Session *s); | |||
int session_load(Session *s); | int session_load(Session *s); | |||
int session_kill(Session *s, KillWho who, int signo); | int session_kill(Session *s, KillWho who, int signo); | |||
char *session_bus_path(Session *s); | ||||
SessionState session_get_state(Session *u); | SessionState session_get_state(Session *u); | |||
extern const DBusObjectPathVTable bus_session_vtable; | extern const sd_bus_vtable session_vtable[]; | |||
int session_node_enumerator(sd_bus *bus, const char *path,void *userdata, c | ||||
har ***nodes, sd_bus_error *error); | ||||
int session_object_find(sd_bus *bus, const char *path, const char *interfac | ||||
e, void *userdata, void **found, sd_bus_error *error); | ||||
char *session_bus_path(Session *s); | ||||
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, ...) _sentinel _; | |||
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); | int session_send_create_reply(Session *s, sd_bus_error *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_; | |||
KillWho kill_who_from_string(const char *s) _pure_; | KillWho kill_who_from_string(const char *s) _pure_; | |||
void session_prepare_vt(Session *s); | ||||
void session_restore_vt(Session *s); | ||||
bool session_is_controller(Session *s, const char *sender); | bool session_is_controller(Session *s, const char *sender); | |||
int session_set_controller(Session *s, const char *sender, bool force); | int session_set_controller(Session *s, const char *sender, bool force); | |||
void session_drop_controller(Session *s); | void session_drop_controller(Session *s); | |||
End of changes. 18 change blocks. | ||||
11 lines changed or deleted | 30 lines changed or added | |||
logind-user.h | logind-user.h | |||
---|---|---|---|---|
skipping to change at line 64 | skipping to change at line 64 | |||
char *service_job; | char *service_job; | |||
char *slice_job; | char *slice_job; | |||
Session *display; | Session *display; | |||
dual_timestamp timestamp; | dual_timestamp timestamp; | |||
bool in_gc_queue:1; | bool in_gc_queue:1; | |||
bool started:1; | bool started:1; | |||
bool closing:1; | bool stopping:1; | |||
LIST_HEAD(Session, sessions); | LIST_HEAD(Session, sessions); | |||
LIST_FIELDS(User, gc_queue); | LIST_FIELDS(User, gc_queue); | |||
}; | }; | |||
User* user_new(Manager *m, uid_t uid, gid_t gid, const char *name); | User* user_new(Manager *m, uid_t uid, gid_t gid, const char *name); | |||
void user_free(User *u); | void user_free(User *u); | |||
int user_check_gc(User *u, bool drop_not_started); | bool user_check_gc(User *u, bool drop_not_started); | |||
void user_add_to_gc_queue(User *u); | void user_add_to_gc_queue(User *u); | |||
int user_start(User *u); | int user_start(User *u); | |||
int user_stop(User *u); | int user_stop(User *u, bool force); | |||
int user_finalize(User *u); | int user_finalize(User *u); | |||
UserState user_get_state(User *u); | UserState user_get_state(User *u); | |||
int user_get_idle_hint(User *u, dual_timestamp *t); | int user_get_idle_hint(User *u, dual_timestamp *t); | |||
int user_save(User *u); | int user_save(User *u); | |||
int user_load(User *u); | int user_load(User *u); | |||
int user_kill(User *u, int signo); | int user_kill(User *u, int signo); | |||
int user_check_linger_file(User *u); | ||||
void user_elect_display(User *u); | ||||
extern const sd_bus_vtable user_vtable[]; | ||||
int user_node_enumerator(sd_bus *bus, const char *path, void *userdata, cha | ||||
r ***nodes, sd_bus_error *error); | ||||
int user_object_find(sd_bus *bus, const char *path, const char *interface, | ||||
void *userdata, void **found, sd_bus_error *error); | ||||
char *user_bus_path(User *s); | char *user_bus_path(User *s); | |||
extern const DBusObjectPathVTable bus_user_vtable; | ||||
int user_send_signal(User *u, bool new_user); | int user_send_signal(User *u, bool new_user); | |||
int user_send_changed(User *u, const char *properties); | int user_send_changed(User *u, const char *properties, ...) _sentinel_; | |||
const char* user_state_to_string(UserState s) _const_; | const char* user_state_to_string(UserState s) _const_; | |||
UserState user_state_from_string(const char *s) _pure_; | UserState user_state_from_string(const char *s) _pure_; | |||
End of changes. 7 change blocks. | ||||
6 lines changed or deleted | 11 lines changed or added | |||
logind.h | logind.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
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/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <dbus/dbus.h> | ||||
#include <libudev.h> | #include <libudev.h> | |||
#include "sd-event.h" | ||||
#include "sd-bus.h" | ||||
#include "util.h" | #include "util.h" | |||
#include "audit.h" | ||||
#include "list.h" | #include "list.h" | |||
#include "hashmap.h" | #include "hashmap.h" | |||
#include "cgroup-util.h" | #include "set.h" | |||
typedef struct Manager Manager; | typedef struct Manager Manager; | |||
#include "logind-device.h" | #include "logind-device.h" | |||
#include "logind-seat.h" | #include "logind-seat.h" | |||
#include "logind-session.h" | #include "logind-session.h" | |||
#include "logind-user.h" | #include "logind-user.h" | |||
#include "logind-inhibit.h" | #include "logind-inhibit.h" | |||
#include "logind-button.h" | #include "logind-button.h" | |||
#include "logind-action.h" | #include "logind-action.h" | |||
#define IGNORE_LID_SWITCH_STARTUP_USEC (3 * USEC_PER_MINUTE) | ||||
#define IGNORE_LID_SWITCH_SUSPEND_USEC (30 * USEC_PER_SEC) | ||||
struct Manager { | struct Manager { | |||
DBusConnection *bus; | sd_event *event; | |||
sd_bus *bus; | ||||
Hashmap *devices; | Hashmap *devices; | |||
Hashmap *seats; | Hashmap *seats; | |||
Hashmap *sessions; | Hashmap *sessions; | |||
Hashmap *users; | Hashmap *users; | |||
Hashmap *inhibitors; | Hashmap *inhibitors; | |||
Hashmap *buttons; | Hashmap *buttons; | |||
Hashmap *busnames; | ||||
Set *busnames; | ||||
LIST_HEAD(Seat, seat_gc_queue); | LIST_HEAD(Seat, seat_gc_queue); | |||
LIST_HEAD(Session, session_gc_queue); | LIST_HEAD(Session, session_gc_queue); | |||
LIST_HEAD(User, user_gc_queue); | LIST_HEAD(User, user_gc_queue); | |||
struct udev *udev; | struct udev *udev; | |||
struct udev_monitor *udev_seat_monitor, *udev_device_monitor, *udev _vcsa_monitor, *udev_button_monitor; | struct udev_monitor *udev_seat_monitor, *udev_device_monitor, *udev _vcsa_monitor, *udev_button_monitor; | |||
int udev_seat_fd; | sd_event_source *console_active_event_source; | |||
int udev_device_fd; | sd_event_source *udev_seat_event_source; | |||
int udev_vcsa_fd; | sd_event_source *udev_device_event_source; | |||
int udev_button_fd; | sd_event_source *udev_vcsa_event_source; | |||
sd_event_source *udev_button_event_source; | ||||
int console_active_fd; | int console_active_fd; | |||
int bus_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 *seat0; | Seat *seat0; | |||
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_units; | Hashmap *session_units; | |||
Hashmap *user_units; | Hashmap *user_units; | |||
Hashmap *session_fds; | ||||
Hashmap *inhibitor_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; | |||
/* If a shutdown/suspend was delayed due to a inhibitor this | /* If a shutdown/suspend was delayed due to a inhibitor this | |||
contains the unit name we are supposed to start after the | contains the unit name we are supposed to start after the | |||
delay is over */ | delay is over */ | |||
const char *action_unit; | const char *action_unit; | |||
/* If a shutdown/suspend is currently executed, then this is | /* If a shutdown/suspend is currently executed, then this is | |||
* the job of it */ | * the job of it */ | |||
char *action_job; | char *action_job; | |||
usec_t action_timestamp; | usec_t action_timestamp; | |||
int idle_action_fd; /* the timer_fd */ | sd_event_source *idle_action_event_source; | |||
usec_t idle_action_usec; | usec_t idle_action_usec; | |||
usec_t idle_action_not_before_usec; | usec_t idle_action_not_before_usec; | |||
HandleAction idle_action; | HandleAction idle_action; | |||
HandleAction handle_power_key; | HandleAction handle_power_key; | |||
HandleAction handle_suspend_key; | HandleAction handle_suspend_key; | |||
HandleAction handle_hibernate_key; | HandleAction handle_hibernate_key; | |||
HandleAction handle_lid_switch; | HandleAction handle_lid_switch; | |||
bool power_key_ignore_inhibited; | bool power_key_ignore_inhibited; | |||
bool suspend_key_ignore_inhibited; | bool suspend_key_ignore_inhibited; | |||
bool hibernate_key_ignore_inhibited; | bool hibernate_key_ignore_inhibited; | |||
bool lid_switch_ignore_inhibited; | bool lid_switch_ignore_inhibited; | |||
}; | ||||
enum { | bool remove_ipc; | |||
FD_SEAT_UDEV, | ||||
FD_DEVICE_UDEV, | Hashmap *polkit_registry; | |||
FD_VCSA_UDEV, | ||||
FD_BUTTON_UDEV, | sd_event_source *lid_switch_ignore_event_source; | |||
FD_CONSOLE, | ||||
FD_BUS, | size_t runtime_dir_size; | |||
FD_IDLE_ACTION, | ||||
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, bool master, Device * *_device); | int manager_add_device(Manager *m, const char *sysfs, bool master, 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, const char *id, Session **_session); | 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_vcsa_udev(Manager *m); | ||||
int manager_dispatch_button_udev(Manager *m); | ||||
int manager_dispatch_console(Manager *m); | ||||
int manager_dispatch_idle_action(Manager *m); | ||||
int manager_enumerate_devices(Manager *m); | ||||
int manager_enumerate_buttons(Manager *m); | ||||
int manager_enumerate_seats(Manager *m); | ||||
int manager_enumerate_sessions(Manager *m); | ||||
int manager_enumerate_users(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, unsigned int vtnr); | |||
void manager_gc(Manager *m, bool drop_not_started); | void manager_gc(Manager *m, bool drop_not_started); | |||
bool manager_shall_kill(Manager *m, const char *user); | bool manager_shall_kill(Manager *m, const char *user); | |||
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_pid(Manager *m, pid_t pid, User **user); | int manager_get_user_by_pid(Manager *m, pid_t pid, User **user); | |||
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; | bool manager_is_docked(Manager *m); | |||
int manager_count_displays(Manager *m); | ||||
extern const sd_bus_vtable manager_vtable[]; | ||||
DBusHandlerResult bus_message_filter(DBusConnection *c, DBusMessage *messag | int match_job_removed(sd_bus *bus, sd_bus_message *message, void *userdata, | |||
e, void *userdata); | sd_bus_error *error); | |||
int match_unit_removed(sd_bus *bus, sd_bus_message *message, void *userdata | ||||
, sd_bus_error *error); | ||||
int match_properties_changed(sd_bus *bus, sd_bus_message *message, void *us | ||||
erdata, sd_bus_error *error); | ||||
int match_reloading(sd_bus *bus, sd_bus_message *message, void *userdata, s | ||||
d_bus_error *error); | ||||
int match_name_owner_changed(sd_bus *bus, sd_bus_message *message, void *us | ||||
erdata, sd_bus_error *error); | ||||
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, sd_bus_error *error); | |||
int manager_send_changed(Manager *manager, const char *properties); | int manager_send_changed(Manager *manager, const char *property, ...) _sent inel_; | |||
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 | int manager_start_scope(Manager *manager, const char *scope, pid_t pid, con | |||
st char *slice, const char *description, const char *after, const char *kil | st char *slice, const char *description, const char *after, const char *aft | |||
l_mode, DBusError *error, char **job); | er2, sd_bus_error *error, char **job); | |||
int manager_start_unit(Manager *manager, const char *unit, DBusError *error | int manager_start_unit(Manager *manager, const char *unit, sd_bus_error *er | |||
, char **job); | ror, char **job); | |||
int manager_stop_unit(Manager *manager, const char *unit, DBusError *error, | int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *err | |||
char **job); | or, char **job); | |||
int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int | int manager_abandon_scope(Manager *manager, const char *scope, sd_bus_error | |||
signo, DBusError *error); | *error); | |||
int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int | ||||
signo, sd_bus_error *error); | ||||
int manager_unit_is_active(Manager *manager, const char *unit); | int manager_unit_is_active(Manager *manager, const char *unit); | |||
int manager_job_is_active(Manager *manager, const char *path); | ||||
/* 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); | |||
int manager_watch_busname(Manager *manager, const char *name); | int manager_watch_busname(Manager *manager, const char *name); | |||
void manager_drop_busname(Manager *manager, const char *name); | void manager_drop_busname(Manager *manager, const char *name); | |||
int manager_set_lid_switch_ignore(Manager *m, usec_t until); | ||||
int config_parse_tmpfs_size(const char *unit, const char *filename, unsigne | ||||
d line, const char *section, unsigned section_line, const char *lvalue, int | ||||
ltype, const char *rvalue, void *data, void *userdata); | ||||
End of changes. 22 change blocks. | ||||
54 lines changed or deleted | 52 lines changed or added | |||
logs-show.h | logs-show.h | |||
---|---|---|---|---|
skipping to change at line 41 | skipping to change at line 41 | |||
#include "output-mode.h" | #include "output-mode.h" | |||
int output_journal( | int output_journal( | |||
FILE *f, | FILE *f, | |||
sd_journal *j, | sd_journal *j, | |||
OutputMode mode, | OutputMode mode, | |||
unsigned n_columns, | unsigned n_columns, | |||
OutputFlags flags, | OutputFlags flags, | |||
bool *ellipsized); | bool *ellipsized); | |||
int add_match_this_boot(sd_journal *j); | int add_match_this_boot(sd_journal *j, const char *machine); | |||
int add_matches_for_unit( | int add_matches_for_unit( | |||
sd_journal *j, | sd_journal *j, | |||
const char *unit); | const char *unit); | |||
int add_matches_for_user_unit( | int add_matches_for_user_unit( | |||
sd_journal *j, | sd_journal *j, | |||
const char *unit, | const char *unit, | |||
uid_t uid); | uid_t uid); | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
machine-id-setup.h | machine-id-setup.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
int machine_id_setup(void); | int machine_id_setup(const char *root); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
machine.h | machine.h | |||
---|---|---|---|---|
skipping to change at line 66 | skipping to change at line 66 | |||
char *name; | char *name; | |||
sd_id128_t id; | sd_id128_t id; | |||
MachineState state; | MachineState state; | |||
MachineClass class; | MachineClass class; | |||
char *state_file; | char *state_file; | |||
char *service; | char *service; | |||
char *root_directory; | char *root_directory; | |||
char *scope; | char *unit; | |||
char *scope_job; | char *scope_job; | |||
pid_t leader; | pid_t leader; | |||
dual_timestamp timestamp; | dual_timestamp timestamp; | |||
bool in_gc_queue:1; | bool in_gc_queue:1; | |||
bool started:1; | bool started:1; | |||
bool registered:1; | ||||
DBusMessage *create_message; | sd_bus_message *create_message; | |||
LIST_FIELDS(Machine, gc_queue); | LIST_FIELDS(Machine, gc_queue); | |||
}; | }; | |||
Machine* machine_new(Manager *manager, const char *name); | Machine* machine_new(Manager *manager, const char *name); | |||
void machine_free(Machine *m); | void machine_free(Machine *m); | |||
int machine_check_gc(Machine *m, bool drop_not_started); | bool machine_check_gc(Machine *m, bool drop_not_started); | |||
void machine_add_to_gc_queue(Machine *m); | void machine_add_to_gc_queue(Machine *m); | |||
int machine_start(Machine *m, DBusMessageIter *iter); | int machine_start(Machine *m, sd_bus_message *properties, sd_bus_error *err or); | |||
int machine_stop(Machine *m); | int machine_stop(Machine *m); | |||
int machine_save(Machine *m); | int machine_save(Machine *m); | |||
int machine_load(Machine *m); | int machine_load(Machine *m); | |||
int machine_kill(Machine *m, KillWho who, int signo); | int machine_kill(Machine *m, KillWho who, int signo); | |||
char *machine_bus_path(Machine *s); | ||||
MachineState machine_get_state(Machine *u); | MachineState machine_get_state(Machine *u); | |||
extern const DBusObjectPathVTable bus_machine_vtable; | extern const sd_bus_vtable machine_vtable[]; | |||
int machine_send_signal(Machine *m, bool new_machine); | char *machine_bus_path(Machine *s); | |||
int machine_send_changed(Machine *m, const char *properties); | int machine_object_find(sd_bus *bus, const char *path, const char *interfac | |||
e, void *userdata, void **found, sd_bus_error *error); | ||||
int machine_node_enumerator(sd_bus *bus, const char *path, void *userdata, | ||||
char ***nodes, sd_bus_error *error); | ||||
int bus_machine_method_terminate(sd_bus *bus, sd_bus_message *message, void | ||||
*userdata, sd_bus_error *error); | ||||
int bus_machine_method_kill(sd_bus *bus, sd_bus_message *message, void *use | ||||
rdata, sd_bus_error *error); | ||||
int bus_machine_method_get_addresses(sd_bus *bus, sd_bus_message *message, | ||||
void *userdata, sd_bus_error *error); | ||||
int bus_machine_method_get_os_release(sd_bus *bus, sd_bus_message *message, | ||||
void *userdata, sd_bus_error *error); | ||||
int machine_send_create_reply(Machine *m, DBusError *error); | int machine_send_signal(Machine *m, bool new_machine); | |||
int machine_send_create_reply(Machine *m, sd_bus_error *error); | ||||
const char* machine_class_to_string(MachineClass t) _const_; | const char* machine_class_to_string(MachineClass t) _const_; | |||
MachineClass machine_class_from_string(const char *s) _pure_; | MachineClass machine_class_from_string(const char *s) _pure_; | |||
const char* machine_state_to_string(MachineState t) _const_; | const char* machine_state_to_string(MachineState t) _const_; | |||
MachineState machine_state_from_string(const char *s) _pure_; | MachineState machine_state_from_string(const char *s) _pure_; | |||
const char *kill_who_to_string(KillWho k) _const_; | const char *kill_who_to_string(KillWho k) _const_; | |||
KillWho kill_who_from_string(const char *s) _pure_; | KillWho kill_who_from_string(const char *s) _pure_; | |||
End of changes. 9 change blocks. | ||||
10 lines changed or deleted | 22 lines changed or added | |||
machined.h | machined.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
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/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <dbus/dbus.h> | ||||
#include "util.h" | #include "util.h" | |||
#include "list.h" | #include "list.h" | |||
#include "hashmap.h" | #include "hashmap.h" | |||
#include "sd-event.h" | ||||
#include "sd-bus.h" | ||||
typedef struct Manager Manager; | typedef struct Manager Manager; | |||
#include "machine.h" | #include "machine.h" | |||
struct Manager { | struct Manager { | |||
DBusConnection *bus; | sd_event *event; | |||
sd_bus *bus; | ||||
int bus_fd; | ||||
int epoll_fd; | ||||
Hashmap *machines; | Hashmap *machines; | |||
Hashmap *machine_units; | Hashmap *machine_units; | |||
Hashmap *machine_leaders; | ||||
LIST_HEAD(Machine, machine_gc_queue); | LIST_HEAD(Machine, machine_gc_queue); | |||
}; | }; | |||
enum { | ||||
FD_BUS | ||||
}; | ||||
Manager *manager_new(void); | Manager *manager_new(void); | |||
void manager_free(Manager *m); | void manager_free(Manager *m); | |||
int manager_add_machine(Manager *m, const char *name, Machine **_machine); | int manager_add_machine(Manager *m, const char *name, Machine **_machine); | |||
int manager_enumerate_machines(Manager *m); | int manager_enumerate_machines(Manager *m); | |||
int manager_startup(Manager *m); | int manager_startup(Manager *m); | |||
int manager_run(Manager *m); | int manager_run(Manager *m); | |||
void manager_gc(Manager *m, bool drop_not_started); | void manager_gc(Manager *m, bool drop_not_started); | |||
int manager_get_machine_by_pid(Manager *m, pid_t pid, Machine **machine); | int manager_get_machine_by_pid(Manager *m, pid_t pid, Machine **machine); | |||
extern const DBusObjectPathVTable bus_manager_vtable; | extern const sd_bus_vtable manager_vtable[]; | |||
DBusHandlerResult bus_message_filter(DBusConnection *c, DBusMessage *messag | ||||
e, void *userdata); | ||||
int manager_start_scope(Manager *manager, const char *scope, pid_t pid, con | int match_reloading(sd_bus *bus, sd_bus_message *message, void *userdata, s | |||
st char *slice, const char *description, DBusMessageIter *more_properties, | d_bus_error *error); | |||
DBusError *error, char **job); | int match_unit_removed(sd_bus *bus, sd_bus_message *message, void *userdata | |||
int manager_stop_unit(Manager *manager, const char *unit, DBusError *error, | , sd_bus_error *error); | |||
char **job); | int match_properties_changed(sd_bus *bus, sd_bus_message *message, void *us | |||
int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int | erdata, sd_bus_error *error); | |||
signo, DBusError *error); | int match_job_removed(sd_bus *bus, sd_bus_message *message, void *userdata, | |||
sd_bus_error *error); | ||||
int manager_start_scope(Manager *manager, const char *scope, pid_t pid, con | ||||
st char *slice, const char *description, sd_bus_message *more_properties, s | ||||
d_bus_error *error, char **job); | ||||
int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *err | ||||
or, char **job); | ||||
int manager_kill_unit(Manager *manager, const char *unit, int signo, sd_bus | ||||
_error *error); | ||||
int manager_unit_is_active(Manager *manager, const char *unit); | int manager_unit_is_active(Manager *manager, const char *unit); | |||
int manager_job_is_active(Manager *manager, const char *path); | ||||
End of changes. 9 change blocks. | ||||
21 lines changed or deleted | 22 lines changed or added | |||
macro.h | macro.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 <assert.h> | #include <assert.h> | |||
#include <sys/param.h> | #include <sys/param.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <sys/uio.h> | #include <sys/uio.h> | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#define _printf_attr_(a,b) __attribute__ ((format (printf, a, b))) | #define _printf_(a,b) __attribute__ ((format (printf, a, b))) | |||
#define _alloc_(...) __attribute__ ((alloc_size(__VA_ARGS__))) | #define _alloc_(...) __attribute__ ((alloc_size(__VA_ARGS__))) | |||
#define _sentinel_ __attribute__ ((sentinel)) | #define _sentinel_ __attribute__ ((sentinel)) | |||
#define _noreturn_ __attribute__((noreturn)) | ||||
#define _unused_ __attribute__ ((unused)) | #define _unused_ __attribute__ ((unused)) | |||
#define _destructor_ __attribute__ ((destructor)) | #define _destructor_ __attribute__ ((destructor)) | |||
#define _pure_ __attribute__ ((pure)) | #define _pure_ __attribute__ ((pure)) | |||
#define _const_ __attribute__ ((const)) | #define _const_ __attribute__ ((const)) | |||
#define _deprecated_ __attribute__ ((deprecated)) | #define _deprecated_ __attribute__ ((deprecated)) | |||
#define _packed_ __attribute__ ((packed)) | #define _packed_ __attribute__ ((packed)) | |||
#define _malloc_ __attribute__ ((malloc)) | #define _malloc_ __attribute__ ((malloc)) | |||
#define _weak_ __attribute__ ((weak)) | #define _weak_ __attribute__ ((weak)) | |||
#define _likely_(x) (__builtin_expect(!!(x),1)) | #define _likely_(x) (__builtin_expect(!!(x),1)) | |||
#define _unlikely_(x) (__builtin_expect(!!(x),0)) | #define _unlikely_(x) (__builtin_expect(!!(x),0)) | |||
#define _public_ __attribute__ ((visibility("default"))) | #define _public_ __attribute__ ((visibility("default"))) | |||
#define _hidden_ __attribute__ ((visibility("hidden"))) | #define _hidden_ __attribute__ ((visibility("hidden"))) | |||
#define _weakref_(x) __attribute__((weakref(#x))) | #define _weakref_(x) __attribute__((weakref(#x))) | |||
#define _introspect_(x) __attribute__((section("introspect." x))) | ||||
#define _alignas_(x) __attribute__((aligned(__alignof(x)))) | #define _alignas_(x) __attribute__((aligned(__alignof(x)))) | |||
#define _cleanup_(x) __attribute__((cleanup(x))) | #define _cleanup_(x) __attribute__((cleanup(x))) | |||
/* Temporarily disable some warnings */ | ||||
#define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \ | ||||
_Pragma("GCC diagnostic push"); \ | ||||
_Pragma("GCC diagnostic ignored \"-Wdeclaration-after-statement\"") | ||||
#define DISABLE_WARNING_FORMAT_NONLITERAL \ | ||||
_Pragma("GCC diagnostic push"); \ | ||||
_Pragma("GCC diagnostic ignored \"-Wformat-nonliteral\"") | ||||
#define DISABLE_WARNING_MISSING_PROTOTYPES \ | ||||
_Pragma("GCC diagnostic push"); \ | ||||
_Pragma("GCC diagnostic ignored \"-Wmissing-prototypes\"") | ||||
#define DISABLE_WARNING_NONNULL \ | ||||
_Pragma("GCC diagnostic push"); \ | ||||
_Pragma("GCC diagnostic ignored \"-Wnonnull\"") | ||||
#define DISABLE_WARNING_SHADOW \ | ||||
_Pragma("GCC diagnostic push"); \ | ||||
_Pragma("GCC diagnostic ignored \"-Wshadow\"") | ||||
#define REENABLE_WARNING \ | ||||
_Pragma("GCC diagnostic pop") | ||||
/* automake test harness */ | /* automake test harness */ | |||
#define EXIT_TEST_SKIP 77 | #define EXIT_TEST_SKIP 77 | |||
#define XSTRINGIFY(x) #x | #define XSTRINGIFY(x) #x | |||
#define STRINGIFY(x) XSTRINGIFY(x) | #define STRINGIFY(x) XSTRINGIFY(x) | |||
#define XCONCATENATE(x, y) x ## y | ||||
#define CONCATENATE(x, y) XCONCATENATE(x, y) | ||||
#define UNIQUE(prefix) CONCATENATE(prefix, __LINE__) | ||||
/* Rounds up */ | /* Rounds up */ | |||
#define ALIGN4(l) (((l) + 3) & ~3) | #define ALIGN4(l) (((l) + 3) & ~3) | |||
#define ALIGN8(l) (((l) + 7) & ~7) | #define ALIGN8(l) (((l) + 7) & ~7) | |||
#if __SIZEOF_POINTER__ == 8 | #if __SIZEOF_POINTER__ == 8 | |||
#define ALIGN(l) ALIGN8(l) | #define ALIGN(l) ALIGN8(l) | |||
#elif __SIZEOF_POINTER__ == 4 | #elif __SIZEOF_POINTER__ == 4 | |||
#define ALIGN(l) ALIGN4(l) | #define ALIGN(l) ALIGN4(l) | |||
#else | #else | |||
skipping to change at line 78 | skipping to change at line 105 | |||
#endif | #endif | |||
#define ALIGN_PTR(p) ((void*) ALIGN((unsigned long) p)) | #define ALIGN_PTR(p) ((void*) ALIGN((unsigned long) p)) | |||
#define ALIGN4_PTR(p) ((void*) ALIGN4((unsigned long) p)) | #define ALIGN4_PTR(p) ((void*) ALIGN4((unsigned long) p)) | |||
#define ALIGN8_PTR(p) ((void*) ALIGN8((unsigned long) p)) | #define ALIGN8_PTR(p) ((void*) ALIGN8((unsigned long) p)) | |||
static inline size_t ALIGN_TO(size_t l, size_t ali) { | static inline size_t ALIGN_TO(size_t l, size_t ali) { | |||
return ((l + ali - 1) & ~(ali - 1)); | return ((l + ali - 1) & ~(ali - 1)); | |||
} | } | |||
#define ALIGN_TO_PTR(p, ali) ((void*) ALIGN_TO((unsigned long) p)) | #define ALIGN_TO_PTR(p, ali) ((void*) ALIGN_TO((unsigned long) p, ali)) | |||
/* align to next higher power-of-2 (except for: 0 => 0, overflow => 0) */ | ||||
static inline unsigned long ALIGN_POWER2(unsigned long u) { | ||||
/* clz(0) is undefined */ | ||||
if (u == 1) | ||||
return 1; | ||||
/* left-shift overflow is undefined */ | ||||
if (__builtin_clzl(u - 1UL) < 1) | ||||
return 0; | ||||
return 1UL << (sizeof(u) * 8 - __builtin_clzl(u - 1UL)); | ||||
} | ||||
#define ELEMENTSOF(x) (sizeof(x)/sizeof((x)[0])) | #define ELEMENTSOF(x) (sizeof(x)/sizeof((x)[0])) | |||
/* | /* | |||
* container_of - cast a member of a structure out to the containing struct ure | * container_of - cast a member of a structure out to the containing struct ure | |||
* @ptr: the pointer to the member. | * @ptr: the pointer to the member. | |||
* @type: the type of the container struct this is embedded in. | * @type: the type of the container struct this is embedded in. | |||
* @member: the name of the member within the struct. | * @member: the name of the member within the struct. | |||
* | * | |||
*/ | */ | |||
skipping to change at line 117 | skipping to change at line 157 | |||
}) | }) | |||
#undef MIN | #undef MIN | |||
#define MIN(a,b) \ | #define MIN(a,b) \ | |||
__extension__ ({ \ | __extension__ ({ \ | |||
typeof(a) _a = (a); \ | typeof(a) _a = (a); \ | |||
typeof(b) _b = (b); \ | typeof(b) _b = (b); \ | |||
_a < _b ? _a : _b; \ | _a < _b ? _a : _b; \ | |||
}) | }) | |||
#define LESS_BY(A,B) \ | ||||
__extension__ ({ \ | ||||
typeof(A) _A = (A); \ | ||||
typeof(B) _B = (B); \ | ||||
_A > _B ? _A - _B : 0; \ | ||||
}) | ||||
#ifndef CLAMP | #ifndef CLAMP | |||
#define CLAMP(x, low, high) \ | #define CLAMP(x, low, high) \ | |||
__extension__ ({ \ | __extension__ ({ \ | |||
typeof(x) _x = (x); \ | typeof(x) _x = (x); \ | |||
typeof(low) _low = (low); \ | typeof(low) _low = (low); \ | |||
typeof(high) _high = (high); \ | typeof(high) _high = (high); \ | |||
((_x > _high) ? _high : ((_x < _low) ? _low : _x)); \ | ((_x > _high) ? _high : ((_x < _low) ? _low : _x)); \ | |||
}) | }) | |||
#endif | #endif | |||
skipping to change at line 147 | skipping to change at line 194 | |||
#else | #else | |||
#define assert(expr) assert_se(expr) | #define assert(expr) assert_se(expr) | |||
#endif | #endif | |||
#define assert_not_reached(t) \ | #define assert_not_reached(t) \ | |||
do { \ | do { \ | |||
log_assert_failed_unreachable(t, __FILE__, __LINE__, __PRET TY_FUNCTION__); \ | log_assert_failed_unreachable(t, __FILE__, __LINE__, __PRET TY_FUNCTION__); \ | |||
} while (false) | } while (false) | |||
#if defined(static_assert) | #if defined(static_assert) | |||
#define assert_cc(expr) \ | /* static_assert() is sometimes defined in a way that trips up | |||
do { \ | * -Wdeclaration-after-statement, hence let's temporarily turn off | |||
static_assert(expr, #expr); \ | * this warning around it. */ | |||
} while (false) | #define assert_cc(expr) \ | |||
DISABLE_WARNING_DECLARATION_AFTER_STATEMENT; \ | ||||
static_assert(expr, #expr); \ | ||||
REENABLE_WARNING | ||||
#else | #else | |||
#define assert_cc(expr) \ | #define assert_cc(expr) \ | |||
do { \ | DISABLE_WARNING_DECLARATION_AFTER_STATEMENT; \ | |||
switch (0) { \ | struct UNIQUE(_assert_struct_) { \ | |||
case 0: \ | char x[(expr) ? 0 : -1]; \ | |||
case !!(expr): \ | }; \ | |||
; \ | REENABLE_WARNING | |||
} \ | ||||
} while (false) | ||||
#endif | #endif | |||
#define assert_return(expr, r) \ | ||||
do { \ | ||||
if (_unlikely_(!(expr))) { \ | ||||
log_assert_failed_return(#expr, __FILE__, __LINE__, | ||||
__PRETTY_FUNCTION__); \ | ||||
return (r); \ | ||||
} \ | ||||
} while (false) | ||||
#define PTR_TO_INT(p) ((int) ((intptr_t) (p))) | #define PTR_TO_INT(p) ((int) ((intptr_t) (p))) | |||
#define INT_TO_PTR(u) ((void *) ((intptr_t) (u))) | #define INT_TO_PTR(u) ((void *) ((intptr_t) (u))) | |||
#define PTR_TO_UINT(p) ((unsigned int) ((uintptr_t) (p))) | #define PTR_TO_UINT(p) ((unsigned int) ((uintptr_t) (p))) | |||
#define UINT_TO_PTR(u) ((void *) ((uintptr_t) (u))) | #define UINT_TO_PTR(u) ((void *) ((uintptr_t) (u))) | |||
#define PTR_TO_LONG(p) ((long) ((intptr_t) (p))) | #define PTR_TO_LONG(p) ((long) ((intptr_t) (p))) | |||
#define LONG_TO_PTR(u) ((void *) ((intptr_t) (u))) | #define LONG_TO_PTR(u) ((void *) ((intptr_t) (u))) | |||
#define PTR_TO_ULONG(p) ((unsigned long) ((uintptr_t) (p))) | #define PTR_TO_ULONG(p) ((unsigned long) ((uintptr_t) (p))) | |||
#define ULONG_TO_PTR(u) ((void *) ((uintptr_t) (u))) | #define ULONG_TO_PTR(u) ((void *) ((uintptr_t) (u))) | |||
skipping to change at line 270 | skipping to change at line 326 | |||
break; \ | break; \ | |||
case PA_DOUBLE|PA_FLAG_LONG_DOUBLE: \ | case PA_DOUBLE|PA_FLAG_LONG_DOUBLE: \ | |||
(void) va_arg(ap, long double); \ | (void) va_arg(ap, long double); \ | |||
break; \ | break; \ | |||
default: \ | default: \ | |||
assert_not_reached("Unknown format string argument. "); \ | assert_not_reached("Unknown format string argument. "); \ | |||
} \ | } \ | |||
} \ | } \ | |||
} while(false) | } while(false) | |||
/* Because statfs.t_type can be int on some architecures, we have to cast | /* Because statfs.t_type can be int on some architectures, we have to cast | |||
* the const magic to the type, otherwise the compiler warns about | * the const magic to the type, otherwise the compiler warns about | |||
* signed/unsigned comparison, because the magic can be 32 bit unsigned. | * signed/unsigned comparison, because the magic can be 32 bit unsigned. | |||
*/ | */ | |||
#define F_TYPE_EQUAL(a, b) (a == (typeof(a)) b) | #define F_TYPE_EQUAL(a, b) (a == (typeof(a)) b) | |||
/* Returns the number of chars needed to format variables of the | /* Returns the number of chars needed to format variables of the | |||
* specified type as a decimal string. Adds in extra space for a | * specified type as a decimal string. Adds in extra space for a | |||
* negative '-' prefix. */ | * negative '-' prefix. */ | |||
#define DECIMAL_STR_MAX(type) \ | #define DECIMAL_STR_MAX(type) \ | |||
(1+(sizeof(type) <= 1 ? 3 : \ | (2+(sizeof(type) <= 1 ? 3 : \ | |||
sizeof(type) <= 2 ? 5 : \ | sizeof(type) <= 2 ? 5 : \ | |||
sizeof(type) <= 4 ? 10 : \ | sizeof(type) <= 4 ? 10 : \ | |||
sizeof(type) <= 8 ? 20 : sizeof(int[-2*(sizeof(type) > 8)]))) | sizeof(type) <= 8 ? 20 : sizeof(int[-2*(sizeof(type) > 8)]))) | |||
#define SET_FLAG(v, flag, b) \ | #define SET_FLAG(v, flag, b) \ | |||
(v) = (b) ? ((v) | (flag)) : ((v) & ~(flag)) | (v) = (b) ? ((v) | (flag)) : ((v) & ~(flag)) | |||
#define IN_SET(x, y, ...) \ | ||||
({ \ | ||||
const typeof(y) _y = (y); \ | ||||
const typeof(_y) _x = (x); \ | ||||
unsigned _i; \ | ||||
bool _found = false; \ | ||||
for (_i = 0; _i < 1 + sizeof((const typeof(_x)[]) { __VA_AR | ||||
GS__ })/sizeof(const typeof(_x)); _i++) \ | ||||
if (((const typeof(_x)[]) { _y, __VA_ARGS__ })[_i] | ||||
== _x) { \ | ||||
_found = true; \ | ||||
break; \ | ||||
} \ | ||||
_found; \ | ||||
}) | ||||
/* Define C11 thread_local attribute even on older gcc compiler | ||||
* version */ | ||||
#ifndef thread_local | ||||
/* | ||||
* Don't break on glibc < 2.16 that doesn't define __STDC_NO_THREADS__ | ||||
* see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53769 | ||||
*/ | ||||
#if __STDC_VERSION__ >= 201112L && !(defined(__STDC_NO_THREADS__) || (defin | ||||
ed(__GNU_LIBRARY__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 16)) | ||||
#define thread_local _Thread_local | ||||
#else | ||||
#define thread_local __thread | ||||
#endif | ||||
#endif | ||||
/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc | ||||
* compiler versions */ | ||||
#ifndef noreturn | ||||
#if __STDC_VERSION__ >= 201112L | ||||
#define noreturn _Noreturn | ||||
#else | ||||
#define noreturn __attribute__((noreturn)) | ||||
#endif | ||||
#endif | ||||
#include "log.h" | #include "log.h" | |||
End of changes. 14 change blocks. | ||||
19 lines changed or deleted | 116 lines changed or added | |||
manager.h | manager.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
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/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#include <dbus/dbus.h> | ||||
#include "sd-bus.h" | ||||
#include "sd-event.h" | ||||
#include "fdset.h" | #include "fdset.h" | |||
#include "cgroup-util.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 struct Watch Watch; | ||||
typedef enum ManagerExitCode { | typedef enum ManagerState { | |||
MANAGER_STARTING, | ||||
MANAGER_RUNNING, | MANAGER_RUNNING, | |||
MANAGER_DEGRADED, | ||||
MANAGER_MAINTENANCE, | ||||
MANAGER_STOPPING, | ||||
_MANAGER_STATE_MAX, | ||||
_MANAGER_STATE_INVALID = -1 | ||||
} ManagerState; | ||||
typedef enum ManagerExitCode { | ||||
MANAGER_OK, | ||||
MANAGER_EXIT, | MANAGER_EXIT, | |||
MANAGER_RELOAD, | MANAGER_RELOAD, | |||
MANAGER_REEXECUTE, | MANAGER_REEXECUTE, | |||
MANAGER_REBOOT, | MANAGER_REBOOT, | |||
MANAGER_POWEROFF, | MANAGER_POWEROFF, | |||
MANAGER_HALT, | MANAGER_HALT, | |||
MANAGER_KEXEC, | MANAGER_KEXEC, | |||
MANAGER_SWITCH_ROOT, | MANAGER_SWITCH_ROOT, | |||
_MANAGER_EXIT_CODE_MAX, | _MANAGER_EXIT_CODE_MAX, | |||
_MANAGER_EXIT_CODE_INVALID = -1 | _MANAGER_EXIT_CODE_INVALID = -1 | |||
} ManagerExitCode; | } ManagerExitCode; | |||
enum WatchType { | ||||
WATCH_INVALID, | ||||
WATCH_SIGNAL, | ||||
WATCH_NOTIFY, | ||||
WATCH_FD, | ||||
WATCH_UNIT_TIMER, | ||||
WATCH_JOB_TIMER, | ||||
WATCH_MOUNT, | ||||
WATCH_SWAP, | ||||
WATCH_UDEV, | ||||
WATCH_DBUS_WATCH, | ||||
WATCH_DBUS_TIMEOUT, | ||||
WATCH_TIME_CHANGE, | ||||
WATCH_JOBS_IN_PROGRESS, | ||||
WATCH_IDLE_PIPE, | ||||
}; | ||||
struct Watch { | ||||
int fd; | ||||
WatchType type; | ||||
union { | ||||
struct Unit *unit; | ||||
struct Job *job; | ||||
DBusWatch *bus_watch; | ||||
DBusTimeout *bus_timeout; | ||||
} data; | ||||
bool fd_is_dupped:1; | ||||
bool socket_accept:1; | ||||
}; | ||||
#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 "path-lookup.h" | #include "path-lookup.h" | |||
#include "execute.h" | #include "execute.h" | |||
#include "unit-name.h" | #include "unit-name.h" | |||
#include "exit-status.h" | ||||
#include "show-status.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 128 | skipping to change at line 108 | |||
/* 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 */ | /* Units that should be realized */ | |||
LIST_HEAD(Unit, cgroup_queue); | LIST_HEAD(Unit, cgroup_queue); | |||
Hashmap *watch_pids; /* pid => Unit object n:1 */ | sd_event *event; | |||
/* We use two hash tables here, since the same PID might be | ||||
* watched by two different units: once the unit that forked | ||||
* it off, and possibly a different unit to which it was | ||||
* joined as cgroup member. Since we know that it is either | ||||
* one or two units for each PID we just use to hashmaps | ||||
* here. */ | ||||
Hashmap *watch_pids1; /* pid => Unit object n:1 */ | ||||
Hashmap *watch_pids2; /* pid => Unit object n:1 */ | ||||
/* A set contains all units which cgroup should be refreshed after | ||||
startup */ | ||||
Set *startup_units; | ||||
/* A set which contains all currently failed units */ | ||||
Set *failed_units; | ||||
sd_event_source *run_queue_event_source; | ||||
char *notify_socket; | char *notify_socket; | |||
int notify_fd; | ||||
sd_event_source *notify_event_source; | ||||
Watch notify_watch; | int signal_fd; | |||
Watch signal_watch; | sd_event_source *signal_event_source; | |||
Watch time_change_watch; | ||||
Watch jobs_in_progress_watch; | ||||
Watch idle_pipe_watch; | ||||
int epoll_fd; | int time_change_fd; | |||
sd_event_source *time_change_event_source; | ||||
sd_event_source *jobs_in_progress_event_source; | ||||
unsigned n_snapshots; | unsigned n_snapshots; | |||
LookupPaths lookup_paths; | LookupPaths lookup_paths; | |||
Set *unit_path_cache; | Set *unit_path_cache; | |||
char **environment; | char **environment; | |||
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 security_start_timestamp; | ||||
dual_timestamp security_finish_timestamp; | ||||
dual_timestamp generators_start_timestamp; | dual_timestamp generators_start_timestamp; | |||
dual_timestamp generators_finish_timestamp; | dual_timestamp generators_finish_timestamp; | |||
dual_timestamp unitsload_start_timestamp; | dual_timestamp units_load_start_timestamp; | |||
dual_timestamp unitsload_finish_timestamp; | dual_timestamp units_load_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 */ | ||||
struct udev* udev; | struct udev* udev; | |||
/* Data specific to the device subsystem */ | ||||
struct udev_monitor* udev_monitor; | struct udev_monitor* udev_monitor; | |||
Watch udev_watch; | sd_event_source *udev_event_source; | |||
Hashmap *devices_by_sysfs; | Hashmap *devices_by_sysfs; | |||
/* Data specific to the mount subsystem */ | /* Data specific to the mount subsystem */ | |||
FILE *proc_self_mountinfo; | FILE *proc_self_mountinfo; | |||
Watch mount_watch; | sd_event_source *mount_event_source; | |||
/* Data specific to the swap filesystem */ | /* Data specific to the swap filesystem */ | |||
FILE *proc_swaps; | FILE *proc_swaps; | |||
Hashmap *swaps_by_proc_swaps; | sd_event_source *swap_event_source; | |||
bool request_reload; | Hashmap *swaps_by_devnode; | |||
Watch swap_watch; | ||||
/* Data specific to the D-Bus subsystem */ | /* Data specific to the D-Bus subsystem */ | |||
DBusConnection *api_bus, *system_bus; | sd_bus *api_bus, *system_bus; | |||
DBusServer *private_bus; | Set *private_buses; | |||
Set *bus_connections, *bus_connections_for_dispatch; | int private_listen_fd; | |||
sd_event_source *private_listen_event_source; | ||||
/* Contains all the clients that are subscribed to signals via | ||||
the API bus. Note that private bus connections are always | ||||
considered subscribes, since they last for very short only, | ||||
and it is much simpler that way. */ | ||||
sd_bus_track *subscribed; | ||||
char **deserialized_subscribed; | ||||
DBusMessage *queued_message; /* This is used during reloading: | sd_bus_message *queued_message; /* This is used during reloading: | |||
* before the reload we queue the | * before the reload we queue the | |||
* reply message here, and | * reply message here, and | |||
* afterwards we send it */ | * afterwards we send it */ | |||
DBusConnection *queued_message_connection; /* The connection to sen d the queued message on */ | sd_bus *queued_message_bus; /* The connection to send the queued me ssage on */ | |||
Hashmap *watch_bus; /* D-Bus names => Unit object n:1 */ | Hashmap *watch_bus; /* D-Bus names => Unit object n:1 */ | |||
int32_t name_data_slot; | ||||
int32_t conn_data_slot; | ||||
int32_t subscribed_data_slot; | ||||
bool send_reloading_done; | bool send_reloading_done; | |||
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 */ | |||
skipping to change at line 222 | skipping to change at line 228 | |||
/* 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; | |||
bool dispatching_load_queue:1; | bool dispatching_load_queue:1; | |||
bool dispatching_run_queue:1; | ||||
bool dispatching_dbus_queue:1; | bool dispatching_dbus_queue:1; | |||
bool taint_usr:1; | bool taint_usr:1; | |||
bool show_status; | ShowStatus show_status; | |||
bool confirm_spawn; | bool confirm_spawn; | |||
bool no_console_output; | bool no_console_output; | |||
ExecOutput default_std_output, default_std_error; | ExecOutput default_std_output, default_std_error; | |||
struct rlimit *rlimit[RLIMIT_NLIMITS]; | usec_t default_restart_usec, default_timeout_start_usec, default_ti | |||
meout_stop_usec; | ||||
usec_t default_start_limit_interval; | ||||
unsigned default_start_limit_burst; | ||||
bool default_cpu_accounting; | ||||
bool default_memory_accounting; | ||||
bool default_blockio_accounting; | ||||
usec_t default_timer_accuracy_usec; | ||||
struct rlimit *rlimit[_RLIMIT_MAX]; | ||||
/* non-zero if we are reloading or reexecuting, */ | /* non-zero if we are reloading or reexecuting, */ | |||
int n_reloading; | int n_reloading; | |||
unsigned n_installed_jobs; | unsigned n_installed_jobs; | |||
unsigned n_failed_jobs; | unsigned n_failed_jobs; | |||
/* Jobs in progress watching */ | /* Jobs in progress watching */ | |||
unsigned n_running_jobs; | unsigned n_running_jobs; | |||
unsigned n_on_console; | unsigned n_on_console; | |||
unsigned jobs_in_progress_iteration; | unsigned jobs_in_progress_iteration; | |||
/* Type=idle pipes */ | /* Type=idle pipes */ | |||
int idle_pipe[4]; | int idle_pipe[4]; | |||
sd_event_source *idle_pipe_event_source; | ||||
char *switch_root; | char *switch_root; | |||
char *switch_root_init; | char *switch_root_init; | |||
/* This maps all possible path prefixes to the units needing | /* This maps all possible path prefixes to the units needing | |||
* them. It's a hashmap with a path string as key and a Set as | * them. It's a hashmap with a path string as key and a Set as | |||
* value where Unit objects are contained. */ | * value where Unit objects are contained. */ | |||
Hashmap *units_requiring_mounts_for; | Hashmap *units_requiring_mounts_for; | |||
/* Reference to the kdbus bus control fd */ | ||||
int kdbus_fd; | ||||
}; | }; | |||
int manager_new(SystemdRunningAs running_as, bool reexecuting, Manager **m) ; | int manager_new(SystemdRunningAs running_as, Manager **m); | |||
void manager_free(Manager *m); | void manager_free(Manager *m); | |||
int manager_enumerate(Manager *m); | int manager_enumerate(Manager *m); | |||
int manager_coldplug(Manager *m); | ||||
int manager_startup(Manager *m, FILE *serialization, FDSet *fds); | int manager_startup(Manager *m, FILE *serialization, FDSet *fds); | |||
Job *manager_get_job(Manager *m, uint32_t id); | Job *manager_get_job(Manager *m, uint32_t id); | |||
Unit *manager_get_unit(Manager *m, const char *name); | Unit *manager_get_unit(Manager *m, const char *name); | |||
int manager_get_unit_by_path(Manager *m, const char *path, const char *suff ix, Unit **_found); | int manager_get_unit_by_path(Manager *m, const char *path, const char *suff ix, Unit **_found); | |||
int manager_get_job_from_dbus_path(Manager *m, const char *s, Job **_j); | int manager_get_job_from_dbus_path(Manager *m, const char *s, Job **_j); | |||
int manager_load_unit_prepare(Manager *m, const char *name, const char *pat | int manager_load_unit_prepare(Manager *m, const char *name, const char *pat | |||
h, DBusError *e, Unit **_ret); | h, sd_bus_error *e, Unit **_ret); | |||
int manager_load_unit(Manager *m, const char *name, const char *path, DBusE | int manager_load_unit(Manager *m, const char *name, const char *path, sd_bu | |||
rror *e, Unit **_ret); | s_error *e, Unit **_ret); | |||
int manager_load_unit_from_dbus_path(Manager *m, const char *s, DBusError * | int manager_load_unit_from_dbus_path(Manager *m, const char *s, sd_bus_erro | |||
e, Unit **_u); | r *e, Unit **_u); | |||
int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, boo | int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, boo | |||
l force, DBusError *e, Job **_ret); | l force, sd_bus_error *e, Job **_ret); | |||
int manager_add_job_by_name(Manager *m, JobType type, const char *name, Job | int manager_add_job_by_name(Manager *m, JobType type, const char *name, Job | |||
Mode mode, bool force, DBusError *e, Job **_ret); | Mode mode, bool force, sd_bus_error *e, Job **_ret); | |||
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_dbus_queue(Manager *m); | ||||
int manager_environment_add(Manager *m, char **environment); | int manager_environment_add(Manager *m, char **minus, char **plus); | |||
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); | ||||
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) ; | |||
int manager_deserialize(Manager *m, FILE *f, FDSet *fds); | int manager_deserialize(Manager *m, FILE *f, FDSet *fds); | |||
int manager_distribute_fds(Manager *m, FDSet *fds); | ||||
int manager_reload(Manager *m); | int manager_reload(Manager *m); | |||
bool manager_is_reloading_or_reexecuting(Manager *m) _pure_; | bool manager_is_reloading_or_reexecuting(Manager *m) _pure_; | |||
void manager_reset_failed(Manager *m); | void manager_reset_failed(Manager *m); | |||
void manager_send_unit_audit(Manager *m, Unit *u, int type, bool success); | void manager_send_unit_audit(Manager *m, Unit *u, int type, bool success); | |||
void manager_send_unit_plymouth(Manager *m, Unit *u); | void manager_send_unit_plymouth(Manager *m, Unit *u); | |||
bool manager_unit_inactive_or_pending(Manager *m, const char *name); | bool manager_unit_inactive_or_pending(Manager *m, const char *name); | |||
void manager_check_finished(Manager *m); | void manager_check_finished(Manager *m); | |||
void manager_run_generators(Manager *m); | void manager_run_generators(Manager *m); | |||
void manager_undo_generators(Manager *m); | void manager_undo_generators(Manager *m); | |||
void manager_recheck_journal(Manager *m); | void manager_recheck_journal(Manager *m); | |||
void manager_set_show_status(Manager *m, bool b); | void manager_set_show_status(Manager *m, ShowStatus mode); | |||
void manager_status_printf(Manager *m, bool ephemeral, const char *status, | void manager_status_printf(Manager *m, bool ephemeral, const char *status, | |||
const char *format, ...) _printf_attr_(4,5); | const char *format, ...) _printf_(4,5); | |||
void manager_flip_auto_status(Manager *m, bool enable); | ||||
Set *manager_get_units_requiring_mounts_for(Manager *m, const char *path); | Set *manager_get_units_requiring_mounts_for(Manager *m, const char *path); | |||
void watch_init(Watch *w); | const char *manager_get_runtime_prefix(Manager *m); | |||
ManagerState manager_state(Manager *m); | ||||
const char *manager_state_to_string(ManagerState m) _const_; | ||||
ManagerState manager_state_from_string(const char *s) _pure_; | ||||
End of changes. 38 change blocks. | ||||
81 lines changed or deleted | 99 lines changed or added | |||
microhttpd-util.h | microhttpd-util.h | |||
---|---|---|---|---|
skipping to change at line 25 | skipping to change at line 25 | |||
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/>. | |||
***/ | ***/ | |||
#pragma once | #pragma once | |||
#include <stdarg.h> | #include <stdarg.h> | |||
#include <microhttpd.h> | ||||
#include "macro.h" | #include "macro.h" | |||
void microhttpd_logger(void *arg, const char *fmt, va_list ap) _printf_attr | void microhttpd_logger(void *arg, const char *fmt, va_list ap) _printf_(2, | |||
_(2, 0); | 0); | |||
/* respond_oom() must be usable with return, hence this form. */ | ||||
#define respond_oom(connection) log_oom(), mhd_respond_oom(connection) | ||||
int mhd_respondf(struct MHD_Connection *connection, | ||||
unsigned code, | ||||
const char *format, ...) _printf_(3,4); | ||||
int mhd_respond(struct MHD_Connection *connection, | ||||
unsigned code, | ||||
const char *message); | ||||
int mhd_respond_oom(struct MHD_Connection *connection); | ||||
int check_permissions(struct MHD_Connection *connection, int *code); | ||||
#ifdef HAVE_GNUTLS | ||||
void log_func_gnutls(int level, const char *message); | ||||
/* This is additionally filtered by our internal log level, so it | ||||
* should be set fairly high to capture all potentially interesting | ||||
* events without overwhelming detail. | ||||
*/ | ||||
#define GNUTLS_LOG_LEVEL 6 | ||||
#endif | ||||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
missing.h | missing.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/>. | |||
***/ | ***/ | |||
/* Missing glibc definitions to access certain kernel APIs */ | /* Missing glibc definitions to access certain kernel APIs */ | |||
#include <sys/resource.h> | #include <sys/resource.h> | |||
#include <sys/syscall.h> | #include <sys/syscall.h> | |||
#include <fcntl.h> | #include <fcntl.h> | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#include <unistd.h> | #include <unistd.h> | |||
#include <errno.h> | ||||
#include <linux/oom.h> | #include <linux/oom.h> | |||
#include <linux/input.h> | #include <linux/input.h> | |||
#include <linux/if_link.h> | ||||
#include <linux/loop.h> | ||||
#include <linux/if_link.h> | ||||
#ifdef HAVE_AUDIT | #ifdef HAVE_AUDIT | |||
#include <libaudit.h> | #include <libaudit.h> | |||
#endif | #endif | |||
#include "macro.h" | #include "macro.h" | |||
#ifdef ARCH_MIPS | #ifdef ARCH_MIPS | |||
#include <asm/sgidefs.h> | #include <asm/sgidefs.h> | |||
#endif | #endif | |||
#ifndef RLIMIT_RTTIME | #ifndef RLIMIT_RTTIME | |||
#define RLIMIT_RTTIME 15 | #define RLIMIT_RTTIME 15 | |||
#endif | #endif | |||
/* If RLIMIT_RTTIME is not defined, then we cannot use RLIMIT_NLIMITS as is | ||||
*/ | ||||
#define _RLIMIT_MAX (RLIMIT_RTTIME+1 > RLIMIT_NLIMITS ? RLIMIT_RTTIME+1 : R | ||||
LIMIT_NLIMITS) | ||||
#ifndef F_LINUX_SPECIFIC_BASE | #ifndef F_LINUX_SPECIFIC_BASE | |||
#define F_LINUX_SPECIFIC_BASE 1024 | #define F_LINUX_SPECIFIC_BASE 1024 | |||
#endif | #endif | |||
#ifndef F_SETPIPE_SZ | #ifndef F_SETPIPE_SZ | |||
#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7) | #define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7) | |||
#endif | #endif | |||
#ifndef F_GETPIPE_SZ | #ifndef F_GETPIPE_SZ | |||
#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8) | #define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8) | |||
skipping to change at line 88 | skipping to change at line 95 | |||
#endif | #endif | |||
#ifndef TIOCVHANGUP | #ifndef TIOCVHANGUP | |||
#define TIOCVHANGUP 0x5437 | #define TIOCVHANGUP 0x5437 | |||
#endif | #endif | |||
#ifndef IP_TRANSPARENT | #ifndef IP_TRANSPARENT | |||
#define IP_TRANSPARENT 19 | #define IP_TRANSPARENT 19 | |||
#endif | #endif | |||
#ifndef SOL_NETLINK | ||||
#define SOL_NETLINK 270 | ||||
#endif | ||||
#if !HAVE_DECL_PIVOT_ROOT | #if !HAVE_DECL_PIVOT_ROOT | |||
static inline int pivot_root(const char *new_root, const char *put_old) { | static inline int pivot_root(const char *new_root, const char *put_old) { | |||
return syscall(SYS_pivot_root, new_root, put_old); | return syscall(SYS_pivot_root, new_root, put_old); | |||
} | } | |||
#endif | #endif | |||
#ifdef __x86_64__ | #ifdef __x86_64__ | |||
# ifndef __NR_fanotify_init | # ifndef __NR_fanotify_init | |||
# define __NR_fanotify_init 300 | # define __NR_fanotify_init 300 | |||
# endif | # endif | |||
skipping to change at line 261 | skipping to change at line 272 | |||
#endif | #endif | |||
#ifndef PR_SET_CHILD_SUBREAPER | #ifndef PR_SET_CHILD_SUBREAPER | |||
#define PR_SET_CHILD_SUBREAPER 36 | #define PR_SET_CHILD_SUBREAPER 36 | |||
#endif | #endif | |||
#ifndef MAX_HANDLE_SZ | #ifndef MAX_HANDLE_SZ | |||
#define MAX_HANDLE_SZ 128 | #define MAX_HANDLE_SZ 128 | |||
#endif | #endif | |||
#if defined __x86_64__ | #ifndef __NR_name_to_handle_at | |||
# ifndef __NR_name_to_handle_at | # if defined(__x86_64__) | |||
# define __NR_name_to_handle_at 303 | # define __NR_name_to_handle_at 303 | |||
# endif | # elif defined(__i386__) | |||
#elif defined __i386__ | ||||
# ifndef __NR_name_to_handle_at | ||||
# define __NR_name_to_handle_at 341 | # define __NR_name_to_handle_at 341 | |||
# endif | # elif defined(__arm__) | |||
#elif defined __arm__ | ||||
# ifndef __NR_name_to_handle_at | ||||
# define __NR_name_to_handle_at 370 | # define __NR_name_to_handle_at 370 | |||
# endif | # elif defined(__powerpc__) | |||
#elif defined __powerpc__ | ||||
# ifndef __NR_name_to_handle_at | ||||
# define __NR_name_to_handle_at 345 | # define __NR_name_to_handle_at 345 | |||
# endif | # else | |||
#else | # error "__NR_name_to_handle_at is not defined" | |||
# ifndef __NR_name_to_handle_at | ||||
# error __NR_name_to_handle_at is not defined | ||||
# endif | # endif | |||
#endif | #endif | |||
#if !HAVE_DECL_NAME_TO_HANDLE_AT | #if !HAVE_DECL_NAME_TO_HANDLE_AT | |||
struct file_handle { | struct file_handle { | |||
unsigned int handle_bytes; | unsigned int handle_bytes; | |||
int handle_type; | int handle_type; | |||
unsigned char f_handle[0]; | unsigned char f_handle[0]; | |||
}; | }; | |||
static inline int name_to_handle_at(int fd, const char *name, struct file_h andle *handle, int *mnt_id, int flags) { | static inline int name_to_handle_at(int fd, const char *name, struct file_h andle *handle, int *mnt_id, int flags) { | |||
return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, fl ags); | return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, fl ags); | |||
} | } | |||
#endif | #endif | |||
#ifndef HAVE_SECURE_GETENV | #ifndef HAVE_SECURE_GETENV | |||
# ifdef HAVE___SECURE_GETENV | # ifdef HAVE___SECURE_GETENV | |||
# define secure_getenv __secure_getenv | # define secure_getenv __secure_getenv | |||
# else | # else | |||
# error neither secure_getenv nor __secure_getenv are available | # error "neither secure_getenv nor __secure_getenv are available" | |||
# endif | # endif | |||
#endif | #endif | |||
#ifndef CIFS_MAGIC_NUMBER | #ifndef CIFS_MAGIC_NUMBER | |||
#define CIFS_MAGIC_NUMBER 0xFF534D42 | # define CIFS_MAGIC_NUMBER 0xFF534D42 | |||
#endif | #endif | |||
#ifndef TFD_TIMER_CANCEL_ON_SET | #ifndef TFD_TIMER_CANCEL_ON_SET | |||
#define TFD_TIMER_CANCEL_ON_SET (1 << 1) | # define TFD_TIMER_CANCEL_ON_SET (1 << 1) | |||
#endif | #endif | |||
#ifndef SO_REUSEPORT | #ifndef SO_REUSEPORT | |||
#define SO_REUSEPORT 15 | # define SO_REUSEPORT 15 | |||
#endif | #endif | |||
#ifndef EVIOCREVOKE | #ifndef EVIOCREVOKE | |||
#define EVIOCREVOKE _IOW('E', 0x91, int) | # define EVIOCREVOKE _IOW('E', 0x91, int) | |||
#endif | #endif | |||
#ifndef DRM_IOCTL_SET_MASTER | #ifndef DRM_IOCTL_SET_MASTER | |||
#define DRM_IOCTL_SET_MASTER _IO('d', 0x1e) | # define DRM_IOCTL_SET_MASTER _IO('d', 0x1e) | |||
#endif | #endif | |||
#ifndef DRM_IOCTL_DROP_MASTER | #ifndef DRM_IOCTL_DROP_MASTER | |||
#define DRM_IOCTL_DROP_MASTER _IO('d', 0x1f) | # define DRM_IOCTL_DROP_MASTER _IO('d', 0x1f) | |||
#endif | ||||
#if defined(__i386__) || defined(__x86_64__) | ||||
/* The precise definition of __O_TMPFILE is arch specific, so let's | ||||
* just define this on x86 where we know the value. */ | ||||
#ifndef __O_TMPFILE | ||||
#define __O_TMPFILE 020000000 | ||||
#endif | ||||
/* a horrid kludge trying to make sure that this will fail on old kernels * | ||||
/ | ||||
#ifndef O_TMPFILE | ||||
#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) | ||||
#endif | ||||
#endif | ||||
#ifndef __NR_setns | ||||
# if defined(__x86_64__) | ||||
# define __NR_setns 308 | ||||
# elif defined(__i386__) | ||||
# define __NR_setns 346 | ||||
# else | ||||
# error "__NR_setns is not defined" | ||||
# endif | ||||
#endif | ||||
#if !HAVE_DECL_SETNS | ||||
static inline int setns(int fd, int nstype) { | ||||
return syscall(__NR_setns, fd, nstype); | ||||
} | ||||
#endif | ||||
#if !HAVE_DECL_LO_FLAGS_PARTSCAN | ||||
#define LO_FLAGS_PARTSCAN 8 | ||||
#endif | ||||
#ifndef LOOP_CTL_REMOVE | ||||
#define LOOP_CTL_REMOVE 0x4C81 | ||||
#endif | ||||
#ifndef LOOP_CTL_GET_FREE | ||||
#define LOOP_CTL_GET_FREE 0x4C82 | ||||
#endif | ||||
#if !HAVE_DECL_IFLA_PHYS_PORT_ID | ||||
#undef IFLA_PROMISCUITY | ||||
#define IFLA_PROMISCUITY 30 | ||||
#define IFLA_NUM_TX_QUEUES 31 | ||||
#define IFLA_NUM_RX_QUEUES 32 | ||||
#define IFLA_CARRIER 33 | ||||
#define IFLA_PHYS_PORT_ID 34 | ||||
#define __IFLA_MAX 35 | ||||
#define IFLA_MAX (__IFLA_MAX - 1) | ||||
#endif | ||||
#if !HAVE_DECL_IFLA_BOND_AD_INFO | ||||
#define IFLA_BOND_UNSPEC 0 | ||||
#define IFLA_BOND_MODE 1 | ||||
#define IFLA_BOND_ACTIVE_SLAVE 2 | ||||
#define IFLA_BOND_MIIMON 3 | ||||
#define IFLA_BOND_UPDELAY 4 | ||||
#define IFLA_BOND_DOWNDELAY 5 | ||||
#define IFLA_BOND_USE_CARRIER 6 | ||||
#define IFLA_BOND_ARP_INTERVAL 7 | ||||
#define IFLA_BOND_ARP_IP_TARGET 8 | ||||
#define IFLA_BOND_ARP_VALIDATE 9 | ||||
#define IFLA_BOND_ARP_ALL_TARGETS 10 | ||||
#define IFLA_BOND_PRIMARY 11 | ||||
#define IFLA_BOND_PRIMARY_RESELECT 12 | ||||
#define IFLA_BOND_FAIL_OVER_MAC 13 | ||||
#define IFLA_BOND_XMIT_HASH_POLICY 14 | ||||
#define IFLA_BOND_RESEND_IGMP 15 | ||||
#define IFLA_BOND_NUM_PEER_NOTIF 16 | ||||
#define IFLA_BOND_ALL_SLAVES_ACTIVE 17 | ||||
#define IFLA_BOND_MIN_LINKS 18 | ||||
#define IFLA_BOND_LP_INTERVAL 19 | ||||
#define IFLA_BOND_PACKETS_PER_SLAVE 20 | ||||
#define IFLA_BOND_AD_LACP_RATE 21 | ||||
#define IFLA_BOND_AD_SELECT 22 | ||||
#define IFLA_BOND_AD_INFO 23 | ||||
#define __IFLA_BOND_MAX 24 | ||||
#define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1) | ||||
#endif | ||||
#if !HAVE_DECL_IFLA_VLAN_PROTOCOL | ||||
#define IFLA_VLAN_UNSPEC 0 | ||||
#define IFLA_VLAN_ID 1 | ||||
#define IFLA_VLAN_FLAGS 2 | ||||
#define IFLA_VLAN_EGRESS_QOS 3 | ||||
#define IFLA_VLAN_INGRESS_QOS 4 | ||||
#define IFLA_VLAN_PROTOCOL 5 | ||||
#define __IFLA_VLAN_MAX 6 | ||||
#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1) | ||||
#endif | ||||
#if !HAVE_DECL_IFLA_VXLAN_LOCAL6 | ||||
#define IFLA_VXLAN_UNSPEC 0 | ||||
#define IFLA_VXLAN_ID 1 | ||||
#define IFLA_VXLAN_GROUP 2 | ||||
#define IFLA_VXLAN_LINK 3 | ||||
#define IFLA_VXLAN_LOCAL 4 | ||||
#define IFLA_VXLAN_TTL 5 | ||||
#define IFLA_VXLAN_TOS 6 | ||||
#define IFLA_VXLAN_LEARNING 7 | ||||
#define IFLA_VXLAN_AGEING 8 | ||||
#define IFLA_VXLAN_LIMIT 9 | ||||
#define IFLA_VXLAN_PORT_RANGE 10 | ||||
#define IFLA_VXLAN_PROXY 11 | ||||
#define IFLA_VXLAN_RSC 12 | ||||
#define IFLA_VXLAN_L2MISS 13 | ||||
#define IFLA_VXLAN_L3MISS 14 | ||||
#define IFLA_VXLAN_PORT 15 | ||||
#define IFLA_VXLAN_GROUP6 16 | ||||
#define IFLA_VXLAN_LOCAL6 17 | ||||
#define __IFLA_VXLAN_MAX 18 | ||||
#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) | ||||
#endif | ||||
#if !HAVE_DECL_IFLA_IPTUN_6RD_RELAY_PREFIXLEN | ||||
#define IFLA_IPTUN_UNSPEC 0 | ||||
#define IFLA_IPTUN_LINK 1 | ||||
#define IFLA_IPTUN_LOCAL 2 | ||||
#define IFLA_IPTUN_REMOTE 3 | ||||
#define IFLA_IPTUN_TTL 4 | ||||
#define IFLA_IPTUN_TOS 5 | ||||
#define IFLA_IPTUN_ENCAP_LIMIT 6 | ||||
#define IFLA_IPTUN_FLOWINFO 7 | ||||
#define IFLA_IPTUN_FLAGS 8 | ||||
#define IFLA_IPTUN_PROTO 9 | ||||
#define IFLA_IPTUN_PMTUDISC 10 | ||||
#define IFLA_IPTUN_6RD_PREFIX 11 | ||||
#define IFLA_IPTUN_6RD_RELAY_PREFIX 12 | ||||
#define IFLA_IPTUN_6RD_PREFIXLEN 13 | ||||
#define IFLA_IPTUN_6RD_RELAY_PREFIXLEN 14 | ||||
#define __IFLA_IPTUN_MAX 15 | ||||
#define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1) | ||||
#endif | ||||
#if !HAVE_DECL_IFLA_BRIDGE_VLAN_INFO | ||||
#define IFLA_BRIDGE_FLAGS 0 | ||||
#define IFLA_BRIDGE_MODE 1 | ||||
#define IFLA_BRIDGE_VLAN_INFO 2 | ||||
#define __IFLA_BRIDGE_MAX 3 | ||||
#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1) | ||||
#endif | #endif | |||
End of changes. 16 change blocks. | ||||
22 lines changed or deleted | 180 lines changed or added | |||
mkdir.h | mkdir.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foomkdirhfoo | #pragma once | |||
#define foomkdirhfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2010 Lennart Poettering | Copyright 2010 Lennart Poettering | |||
Copyright 2013 Kay Sievers | Copyright 2013 Kay Sievers | |||
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 | |||
skipping to change at line 45 | skipping to change at line 44 | |||
int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid); | int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid); | |||
int mkdir_parents_label(const char *path, mode_t mode); | int mkdir_parents_label(const char *path, mode_t mode); | |||
int mkdir_p_label(const char *path, mode_t mode); | int mkdir_p_label(const char *path, mode_t mode); | |||
int mkdir_parents_prefix_label(const char *prefix, const char *path, mode_t mode); | int mkdir_parents_prefix_label(const char *prefix, const char *path, mode_t mode); | |||
/* internally used */ | /* internally used */ | |||
typedef int (*mkdir_func_t)(const char *pathname, mode_t mode); | typedef int (*mkdir_func_t)(const char *pathname, mode_t mode); | |||
int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid , mkdir_func_t _mkdir); | int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid , mkdir_func_t _mkdir); | |||
int mkdir_parents_internal(const char *prefix, const char *path, mode_t mod e, mkdir_func_t _mkdir); | int mkdir_parents_internal(const char *prefix, const char *path, mode_t mod e, mkdir_func_t _mkdir); | |||
int mkdir_p_internal(const char *prefix, const char *path, mode_t mode, mkd ir_func_t _mkdir); | int mkdir_p_internal(const char *prefix, const char *path, mode_t mode, mkd ir_func_t _mkdir); | |||
#endif | int is_dir(const char *path, bool is_dir); | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added | |||
mmap-cache.h | mmap-cache.h | |||
---|---|---|---|---|
skipping to change at line 34 | skipping to change at line 34 | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <sys/stat.h> | #include <sys/stat.h> | |||
typedef struct MMapCache MMapCache; | typedef struct MMapCache MMapCache; | |||
MMapCache* mmap_cache_new(void); | MMapCache* mmap_cache_new(void); | |||
MMapCache* mmap_cache_ref(MMapCache *m); | MMapCache* mmap_cache_ref(MMapCache *m); | |||
MMapCache* mmap_cache_unref(MMapCache *m); | MMapCache* mmap_cache_unref(MMapCache *m); | |||
int mmap_cache_get(MMapCache *m, int fd, int prot, unsigned context, bool k | int mmap_cache_get( | |||
eep_always, uint64_t offset, size_t size, struct stat *st, void **ret); | MMapCache *m, | |||
int fd, | ||||
int prot, | ||||
unsigned context, | ||||
bool keep_always, | ||||
uint64_t offset, | ||||
size_t size, | ||||
struct stat *st, | ||||
void **ret); | ||||
int mmap_cache_release( | ||||
MMapCache *m, | ||||
int fd, | ||||
int prot, | ||||
unsigned context, | ||||
uint64_t offset, | ||||
size_t size); | ||||
void mmap_cache_close_fd(MMapCache *m, int fd); | void mmap_cache_close_fd(MMapCache *m, int fd); | |||
void mmap_cache_close_context(MMapCache *m, unsigned context); | void mmap_cache_close_context(MMapCache *m, unsigned context); | |||
unsigned mmap_cache_get_hit(MMapCache *m); | ||||
unsigned mmap_cache_get_missed(MMapCache *m); | ||||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 17 lines changed or added | |||
mount.h | mount.h | |||
---|---|---|---|---|
skipping to change at line 57 | skipping to change at line 57 | |||
} MountState; | } MountState; | |||
typedef enum MountExecCommand { | typedef enum MountExecCommand { | |||
MOUNT_EXEC_MOUNT, | MOUNT_EXEC_MOUNT, | |||
MOUNT_EXEC_UNMOUNT, | MOUNT_EXEC_UNMOUNT, | |||
MOUNT_EXEC_REMOUNT, | MOUNT_EXEC_REMOUNT, | |||
_MOUNT_EXEC_COMMAND_MAX, | _MOUNT_EXEC_COMMAND_MAX, | |||
_MOUNT_EXEC_COMMAND_INVALID = -1 | _MOUNT_EXEC_COMMAND_INVALID = -1 | |||
} MountExecCommand; | } MountExecCommand; | |||
typedef struct MountParameters { | ||||
char *what; | ||||
char *options; | ||||
char *fstype; | ||||
int passno; | ||||
} MountParameters; | ||||
typedef enum MountResult { | typedef enum MountResult { | |||
MOUNT_SUCCESS, | MOUNT_SUCCESS, | |||
MOUNT_FAILURE_RESOURCES, | MOUNT_FAILURE_RESOURCES, | |||
MOUNT_FAILURE_TIMEOUT, | MOUNT_FAILURE_TIMEOUT, | |||
MOUNT_FAILURE_EXIT_CODE, | MOUNT_FAILURE_EXIT_CODE, | |||
MOUNT_FAILURE_SIGNAL, | MOUNT_FAILURE_SIGNAL, | |||
MOUNT_FAILURE_CORE_DUMP, | MOUNT_FAILURE_CORE_DUMP, | |||
_MOUNT_RESULT_MAX, | _MOUNT_RESULT_MAX, | |||
_MOUNT_RESULT_INVALID = -1 | _MOUNT_RESULT_INVALID = -1 | |||
} MountResult; | } MountResult; | |||
typedef struct MountParameters { | ||||
char *what; | ||||
char *options; | ||||
char *fstype; | ||||
} MountParameters; | ||||
struct Mount { | struct Mount { | |||
Unit meta; | Unit meta; | |||
char *where; | char *where; | |||
MountParameters parameters_proc_self_mountinfo; | MountParameters parameters_proc_self_mountinfo; | |||
MountParameters parameters_fragment; | MountParameters parameters_fragment; | |||
bool from_proc_self_mountinfo:1; | bool from_proc_self_mountinfo:1; | |||
bool from_fragment:1; | bool from_fragment:1; | |||
/* Used while looking for mount points that vanished or got | /* Used while looking for mount points that vanished or got | |||
* added from/to /proc/self/mountinfo */ | * added from/to /proc/self/mountinfo */ | |||
bool is_mounted:1; | bool is_mounted:1; | |||
bool just_mounted:1; | bool just_mounted:1; | |||
bool just_changed:1; | bool just_changed:1; | |||
bool sloppy_options; | ||||
MountResult result; | MountResult result; | |||
MountResult reload_result; | MountResult reload_result; | |||
mode_t directory_mode; | mode_t directory_mode; | |||
usec_t timeout_usec; | usec_t timeout_usec; | |||
ExecCommand exec_command[_MOUNT_EXEC_COMMAND_MAX]; | ExecCommand exec_command[_MOUNT_EXEC_COMMAND_MAX]; | |||
ExecContext exec_context; | ExecContext exec_context; | |||
KillContext kill_context; | KillContext kill_context; | |||
CGroupContext cgroup_context; | CGroupContext cgroup_context; | |||
ExecRuntime *exec_runtime; | ||||
MountState state, deserialized_state; | MountState state, deserialized_state; | |||
ExecCommand* control_command; | ExecCommand* control_command; | |||
MountExecCommand control_command_id; | MountExecCommand control_command_id; | |||
pid_t control_pid; | pid_t control_pid; | |||
Watch timer_watch; | sd_event_source *timer_event_source; | |||
}; | }; | |||
extern const UnitVTable mount_vtable; | extern const UnitVTable mount_vtable; | |||
void mount_fd_event(Manager *m, int events); | void mount_fd_event(Manager *m, int events); | |||
const char* mount_state_to_string(MountState i) _const_; | const char* mount_state_to_string(MountState i) _const_; | |||
MountState mount_state_from_string(const char *s) _pure_; | MountState mount_state_from_string(const char *s) _pure_; | |||
const char* mount_exec_command_to_string(MountExecCommand i) _const_; | const char* mount_exec_command_to_string(MountExecCommand i) _const_; | |||
End of changes. 5 change blocks. | ||||
8 lines changed or deleted | 11 lines changed or added | |||
namespace.h | namespace.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
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/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
int setup_tmpdirs(char **tmp_dir, char **var_tmp_dir); | #include "macro.h" | |||
typedef enum ProtectHome { | ||||
PROTECT_HOME_NO, | ||||
PROTECT_HOME_YES, | ||||
PROTECT_HOME_READ_ONLY, | ||||
_PROTECT_HOME_MAX, | ||||
_PROTECT_HOME_INVALID = -1 | ||||
} ProtectHome; | ||||
typedef enum ProtectSystem { | ||||
PROTECT_SYSTEM_NO, | ||||
PROTECT_SYSTEM_YES, | ||||
PROTECT_SYSTEM_FULL, | ||||
_PROTECT_SYSTEM_MAX, | ||||
_PROTECT_SYSTEM_INVALID = -1 | ||||
} ProtectSystem; | ||||
int setup_namespace(char **read_write_dirs, | int setup_namespace(char **read_write_dirs, | |||
char **read_only_dirs, | char **read_only_dirs, | |||
char **inaccessible_dirs, | char **inaccessible_dirs, | |||
char *tmp_dir, | char *tmp_dir, | |||
char *var_tmp_dir, | char *var_tmp_dir, | |||
bool private_tmp, | bool private_dev, | |||
ProtectHome protect_home, | ||||
ProtectSystem protect_system, | ||||
unsigned mount_flags); | unsigned mount_flags); | |||
int setup_tmp_dirs(const char *id, | ||||
char **tmp_dir, | ||||
char **var_tmp_dir); | ||||
int setup_netns(int netns_storage_socket[2]); | ||||
const char* protect_home_to_string(ProtectHome p) _const_; | ||||
ProtectHome protect_home_from_string(const char *s) _pure_; | ||||
const char* protect_system_to_string(ProtectSystem p) _const_; | ||||
ProtectSystem protect_system_from_string(const char *s) _pure_; | ||||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 21 lines changed or added | |||
output-mode.h | output-mode.h | |||
---|---|---|---|---|
skipping to change at line 45 | skipping to change at line 45 | |||
_OUTPUT_MODE_MAX, | _OUTPUT_MODE_MAX, | |||
_OUTPUT_MODE_INVALID = -1 | _OUTPUT_MODE_INVALID = -1 | |||
} OutputMode; | } OutputMode; | |||
typedef enum OutputFlags { | typedef enum OutputFlags { | |||
OUTPUT_SHOW_ALL = 1 << 0, | OUTPUT_SHOW_ALL = 1 << 0, | |||
OUTPUT_FOLLOW = 1 << 1, | OUTPUT_FOLLOW = 1 << 1, | |||
OUTPUT_WARN_CUTOFF = 1 << 2, | OUTPUT_WARN_CUTOFF = 1 << 2, | |||
OUTPUT_FULL_WIDTH = 1 << 3, | OUTPUT_FULL_WIDTH = 1 << 3, | |||
OUTPUT_COLOR = 1 << 4, | OUTPUT_COLOR = 1 << 4, | |||
OUTPUT_CATALOG = 1 << 5 | OUTPUT_CATALOG = 1 << 5, | |||
OUTPUT_BEGIN_NEWLINE = 1 << 6, | ||||
} OutputFlags; | } OutputFlags; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
path-lookup.h | path-lookup.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include "macro.h" | ||||
typedef struct LookupPaths { | typedef struct LookupPaths { | |||
char **unit_path; | char **unit_path; | |||
#ifdef HAVE_SYSV_COMPAT | #ifdef HAVE_SYSV_COMPAT | |||
char **sysvinit_path; | char **sysvinit_path; | |||
char **sysvrcnd_path; | char **sysvrcnd_path; | |||
#endif | #endif | |||
} LookupPaths; | } LookupPaths; | |||
typedef enum SystemdRunningAs { | typedef enum SystemdRunningAs { | |||
SYSTEMD_SYSTEM, | SYSTEMD_SYSTEM, | |||
SYSTEMD_USER, | SYSTEMD_USER, | |||
_SYSTEMD_RUNNING_AS_MAX, | _SYSTEMD_RUNNING_AS_MAX, | |||
_SYSTEMD_RUNNING_AS_INVALID = -1 | _SYSTEMD_RUNNING_AS_INVALID = -1 | |||
} SystemdRunningAs; | } SystemdRunningAs; | |||
#define _cleanup_lookup_paths_free_ _cleanup_(lookup_paths_free) | ||||
const char* systemd_running_as_to_string(SystemdRunningAs i) _const_; | const char* systemd_running_as_to_string(SystemdRunningAs i) _const_; | |||
SystemdRunningAs systemd_running_as_from_string(const char *s) _pure_; | SystemdRunningAs systemd_running_as_from_string(const char *s) _pure_; | |||
int user_config_home(char **config_home); | int user_config_home(char **config_home); | |||
int lookup_paths_init(LookupPaths *p, SystemdRunningAs running_as, bool per | int lookup_paths_init(LookupPaths *p, | |||
sonal, const char *generator, const char *generator_early, const char *gene | SystemdRunningAs running_as, | |||
rator_late); | bool personal, | |||
const char *root_dir, | ||||
const char *generator, | ||||
const char *generator_early, | ||||
const char *generator_late); | ||||
void lookup_paths_free(LookupPaths *p); | void lookup_paths_free(LookupPaths *p); | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 11 lines changed or added | |||
path-util.h | path-util.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
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/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include "macro.h" | #include "macro.h" | |||
#include "time-util.h" | ||||
#define DEFAULT_PATH_NORMAL "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/ | ||||
bin" | ||||
#define DEFAULT_PATH_SPLIT_USR DEFAULT_PATH_NORMAL ":/sbin:/bin" | ||||
#ifdef HAVE_SPLIT_USR | #ifdef HAVE_SPLIT_USR | |||
# define DEFAULT_PATH "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/ sbin:/bin" | # define DEFAULT_PATH DEFAULT_PATH_SPLIT_USR | |||
#else | #else | |||
# define DEFAULT_PATH "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" | # define DEFAULT_PATH DEFAULT_PATH_NORMAL | |||
#endif | #endif | |||
bool is_path(const char *p) _pure_; | bool is_path(const char *p) _pure_; | |||
char** path_split_and_make_absolute(const char *p); | char** path_split_and_make_absolute(const char *p); | |||
char* path_get_file_name(const char *p) _pure_; | ||||
int path_get_parent(const char *path, char **parent); | int path_get_parent(const char *path, char **parent); | |||
bool path_is_absolute(const char *p) _pure_; | bool path_is_absolute(const char *p) _pure_; | |||
char* path_make_absolute(const char *p, const char *prefix); | char* path_make_absolute(const char *p, const char *prefix); | |||
char* path_make_absolute_cwd(const char *p); | char* path_make_absolute_cwd(const char *p); | |||
int path_make_relative(const char *from_dir, const char *to_path, char **_r ); | ||||
char* path_kill_slashes(char *path); | char* path_kill_slashes(char *path); | |||
char* path_startswith(const char *path, const char *prefix) _pure_; | char* path_startswith(const char *path, const char *prefix) _pure_; | |||
bool path_equal(const char *a, const char *b) _pure_; | bool path_equal(const char *a, const char *b) _pure_; | |||
char** path_strv_make_absolute_cwd(char **l); | char** path_strv_make_absolute_cwd(char **l); | |||
char** path_strv_canonicalize(char **l); | char** path_strv_resolve(char **l, const char *prefix); | |||
char** path_strv_canonicalize_uniq(char **l); | char** path_strv_resolve_uniq(char **l, const char *prefix); | |||
int path_is_mount_point(const char *path, bool allow_symlink); | int path_is_mount_point(const char *path, bool allow_symlink); | |||
int path_is_read_only_fs(const char *path); | int path_is_read_only_fs(const char *path); | |||
int path_is_os_tree(const char *path); | int path_is_os_tree(const char *path); | |||
int find_binary(const char *name, char **filename); | int find_binary(const char *name, char **filename); | |||
bool paths_check_timestamp(const char* const* paths, usec_t *paths_ts_usec, | ||||
bool update); | ||||
int fsck_exists(const char *fstype); | ||||
/* Iterates through the path prefixes of the specified path, going up | /* Iterates through the path prefixes of the specified path, going up | |||
* the tree, to root. Also returns "" (and not "/"!) for the root | * the tree, to root. Also returns "" (and not "/"!) for the root | |||
* directory. Excludes the specified directory itself */ | * directory. Excludes the specified directory itself */ | |||
#define PATH_FOREACH_PREFIX(prefix, path) \ | #define PATH_FOREACH_PREFIX(prefix, path) \ | |||
for (char *_slash = ({ path_kill_slashes(strcpy(prefix, path)); str eq(prefix, "/") ? NULL : strrchr(prefix, '/'); }); _slash && !(*_slash = 0) ; _slash = strrchr((prefix), '/')) | for (char *_slash = ({ path_kill_slashes(strcpy(prefix, path)); str eq(prefix, "/") ? NULL : strrchr(prefix, '/'); }); _slash && !(*_slash = 0) ; _slash = strrchr((prefix), '/')) | |||
/* Same as PATH_FOREACH_PREFIX but also includes the specified path itself */ | /* Same as PATH_FOREACH_PREFIX but also includes the specified path itself */ | |||
#define PATH_FOREACH_PREFIX_MORE(prefix, path) \ | #define PATH_FOREACH_PREFIX_MORE(prefix, path) \ | |||
for (char *_slash = ({ path_kill_slashes(strcpy(prefix, path)); if (streq(prefix, "/")) prefix[0] = 0; strrchr(prefix, 0); }); _slash && !(*_s lash = 0); _slash = strrchr((prefix), '/')) | for (char *_slash = ({ path_kill_slashes(strcpy(prefix, path)); if (streq(prefix, "/")) prefix[0] = 0; strrchr(prefix, 0); }); _slash && !(*_s lash = 0); _slash = strrchr((prefix), '/')) | |||
End of changes. 7 change blocks. | ||||
5 lines changed or deleted | 15 lines changed or added | |||
path.h | path.h | |||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
PATH_EXISTS, | PATH_EXISTS, | |||
PATH_EXISTS_GLOB, | PATH_EXISTS_GLOB, | |||
PATH_DIRECTORY_NOT_EMPTY, | PATH_DIRECTORY_NOT_EMPTY, | |||
PATH_CHANGED, | PATH_CHANGED, | |||
PATH_MODIFIED, | PATH_MODIFIED, | |||
_PATH_TYPE_MAX, | _PATH_TYPE_MAX, | |||
_PATH_TYPE_INVALID = -1 | _PATH_TYPE_INVALID = -1 | |||
} PathType; | } PathType; | |||
typedef struct PathSpec { | typedef struct PathSpec { | |||
Unit *unit; | ||||
char *path; | char *path; | |||
Watch watch; | sd_event_source *event_source; | |||
LIST_FIELDS(struct PathSpec, spec); | LIST_FIELDS(struct PathSpec, spec); | |||
PathType type; | PathType type; | |||
int inotify_fd; | int inotify_fd; | |||
int primary_wd; | int primary_wd; | |||
bool previous_exists; | bool previous_exists; | |||
} PathSpec; | } PathSpec; | |||
int path_spec_watch(PathSpec *s, Unit *u); | int path_spec_watch(PathSpec *s, sd_event_io_handler_t handler); | |||
void path_spec_unwatch(PathSpec *s, Unit *u); | void path_spec_unwatch(PathSpec *s); | |||
int path_spec_fd_event(PathSpec *s, uint32_t events); | int path_spec_fd_event(PathSpec *s, uint32_t events); | |||
void path_spec_done(PathSpec *s); | void path_spec_done(PathSpec *s); | |||
static inline bool path_spec_owns_inotify_fd(PathSpec *s, int fd) { | static inline bool path_spec_owns_inotify_fd(PathSpec *s, int fd) { | |||
return s->inotify_fd == fd; | return s->inotify_fd == fd; | |||
} | } | |||
typedef enum PathResult { | typedef enum PathResult { | |||
PATH_SUCCESS, | PATH_SUCCESS, | |||
PATH_FAILURE_RESOURCES, | PATH_FAILURE_RESOURCES, | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 5 lines changed or added | |||
prioq.h | prioq.h | |||
---|---|---|---|---|
skipping to change at line 28 | skipping to change at line 28 | |||
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/>. | |||
***/ | ***/ | |||
#include "hashmap.h" | #include "hashmap.h" | |||
typedef struct Prioq Prioq; | typedef struct Prioq Prioq; | |||
#define PRIOQ_IDX_NULL ((unsigned) -1) | ||||
Prioq *prioq_new(compare_func_t compare); | Prioq *prioq_new(compare_func_t compare); | |||
void prioq_free(Prioq *q); | void prioq_free(Prioq *q); | |||
int prioq_ensure_allocated(Prioq **q, compare_func_t compare_func); | int prioq_ensure_allocated(Prioq **q, compare_func_t compare_func); | |||
int prioq_put(Prioq *q, void *data, unsigned *idx); | int prioq_put(Prioq *q, void *data, unsigned *idx); | |||
int prioq_remove(Prioq *q, void *data, unsigned *idx); | int prioq_remove(Prioq *q, void *data, unsigned *idx); | |||
int prioq_reshuffle(Prioq *q, void *data, unsigned *idx); | int prioq_reshuffle(Prioq *q, void *data, unsigned *idx); | |||
void *prioq_peek(Prioq *q) _pure_; | void *prioq_peek(Prioq *q) _pure_; | |||
void *prioq_pop(Prioq *q); | void *prioq_pop(Prioq *q); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 2 lines changed or added | |||
scope.h | scope.h | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
***/ | ***/ | |||
typedef struct Scope Scope; | typedef struct Scope Scope; | |||
#include "unit.h" | #include "unit.h" | |||
#include "kill.h" | #include "kill.h" | |||
typedef enum ScopeState { | typedef enum ScopeState { | |||
SCOPE_DEAD, | SCOPE_DEAD, | |||
SCOPE_RUNNING, | SCOPE_RUNNING, | |||
SCOPE_ABANDONED, | ||||
SCOPE_STOP_SIGTERM, | SCOPE_STOP_SIGTERM, | |||
SCOPE_STOP_SIGKILL, | SCOPE_STOP_SIGKILL, | |||
SCOPE_FAILED, | SCOPE_FAILED, | |||
_SCOPE_STATE_MAX, | _SCOPE_STATE_MAX, | |||
_SCOPE_STATE_INVALID = -1 | _SCOPE_STATE_INVALID = -1 | |||
} ScopeState; | } ScopeState; | |||
typedef enum ScopeResult { | typedef enum ScopeResult { | |||
SCOPE_SUCCESS, | SCOPE_SUCCESS, | |||
SCOPE_FAILURE_RESOURCES, | SCOPE_FAILURE_RESOURCES, | |||
skipping to change at line 58 | skipping to change at line 59 | |||
Unit meta; | Unit meta; | |||
CGroupContext cgroup_context; | CGroupContext cgroup_context; | |||
KillContext kill_context; | KillContext kill_context; | |||
ScopeState state, deserialized_state; | ScopeState state, deserialized_state; | |||
ScopeResult result; | ScopeResult result; | |||
usec_t timeout_stop_usec; | usec_t timeout_stop_usec; | |||
Set *pids; | char *controller; | |||
Watch timer_watch; | sd_event_source *timer_event_source; | |||
}; | }; | |||
extern const UnitVTable scope_vtable; | extern const UnitVTable scope_vtable; | |||
int scope_abandon(Scope *s); | ||||
const char* scope_state_to_string(ScopeState i) _const_; | const char* scope_state_to_string(ScopeState i) _const_; | |||
ScopeState scope_state_from_string(const char *s) _pure_; | ScopeState scope_state_from_string(const char *s) _pure_; | |||
const char* scope_result_to_string(ScopeResult i) _const_; | const char* scope_result_to_string(ScopeResult i) _const_; | |||
ScopeResult scope_result_from_string(const char *s) _pure_; | ScopeResult scope_result_from_string(const char *s) _pure_; | |||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 5 lines changed or added | |||
scsi_id.h | scsi_id.h | |||
---|---|---|---|---|
skipping to change at line 69 | skipping to change at line 69 | |||
}; | }; | |||
int scsi_std_inquiry(struct udev *udev, struct scsi_id_device *dev_scsi, co nst char *devname); | int scsi_std_inquiry(struct udev *udev, struct scsi_id_device *dev_scsi, co nst char *devname); | |||
int scsi_get_serial(struct udev *udev, struct scsi_id_device *dev_scsi, con st char *devname, | int scsi_get_serial(struct udev *udev, struct scsi_id_device *dev_scsi, con st char *devname, | |||
int page_code, int len); | int page_code, int len); | |||
/* | /* | |||
* Page code values. | * Page code values. | |||
*/ | */ | |||
enum page_code { | enum page_code { | |||
PAGE_83_PRE_SPC3 = -0x83, | PAGE_83_PRE_SPC3 = -0x83, | |||
PAGE_UNSPECIFIED = 0x00, | PAGE_UNSPECIFIED = 0x00, | |||
PAGE_80 = 0x80, | PAGE_80 = 0x80, | |||
PAGE_83 = 0x83, | PAGE_83 = 0x83, | |||
}; | }; | |||
End of changes. 1 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
sd-bus-protocol.h | sd-bus-protocol.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/>. | |||
***/ | ***/ | |||
#include <endian.h> | #include "_sd-common.h" | |||
#ifdef __cplusplus | _SD_BEGIN_DECLARATIONS; | |||
extern "C" { | ||||
#endif | ||||
/* Types of message */ | /* Types of message */ | |||
enum { | enum { | |||
_SD_BUS_MESSAGE_TYPE_INVALID = 0, | _SD_BUS_MESSAGE_TYPE_INVALID = 0, | |||
SD_BUS_MESSAGE_TYPE_METHOD_CALL, | SD_BUS_MESSAGE_METHOD_CALL, | |||
SD_BUS_MESSAGE_TYPE_METHOD_RETURN, | SD_BUS_MESSAGE_METHOD_RETURN, | |||
SD_BUS_MESSAGE_TYPE_METHOD_ERROR, | SD_BUS_MESSAGE_METHOD_ERROR, | |||
SD_BUS_MESSAGE_TYPE_SIGNAL, | SD_BUS_MESSAGE_SIGNAL, | |||
_SD_BUS_MESSAGE_TYPE_MAX | _SD_BUS_MESSAGE_TYPE_MAX | |||
}; | }; | |||
/* Primitive types */ | /* Primitive types */ | |||
enum { | enum { | |||
_SD_BUS_TYPE_INVALID = 0, | _SD_BUS_TYPE_INVALID = 0, | |||
SD_BUS_TYPE_BYTE = 'y', | SD_BUS_TYPE_BYTE = 'y', | |||
SD_BUS_TYPE_BOOLEAN = 'b', | SD_BUS_TYPE_BOOLEAN = 'b', | |||
SD_BUS_TYPE_INT16 = 'n', | SD_BUS_TYPE_INT16 = 'n', | |||
skipping to change at line 69 | skipping to change at line 67 | |||
SD_BUS_TYPE_ARRAY = 'a', | SD_BUS_TYPE_ARRAY = 'a', | |||
SD_BUS_TYPE_VARIANT = 'v', | SD_BUS_TYPE_VARIANT = 'v', | |||
SD_BUS_TYPE_STRUCT = 'r', /* not actually used in signatu res */ | SD_BUS_TYPE_STRUCT = 'r', /* not actually used in signatu res */ | |||
SD_BUS_TYPE_STRUCT_BEGIN = '(', | SD_BUS_TYPE_STRUCT_BEGIN = '(', | |||
SD_BUS_TYPE_STRUCT_END = ')', | SD_BUS_TYPE_STRUCT_END = ')', | |||
SD_BUS_TYPE_DICT_ENTRY = 'e', /* not actually used in signatu res */ | SD_BUS_TYPE_DICT_ENTRY = 'e', /* not actually used in signatu res */ | |||
SD_BUS_TYPE_DICT_ENTRY_BEGIN = '{', | SD_BUS_TYPE_DICT_ENTRY_BEGIN = '{', | |||
SD_BUS_TYPE_DICT_ENTRY_END = '}', | SD_BUS_TYPE_DICT_ENTRY_END = '}', | |||
}; | }; | |||
/* Endianness */ | /* Well-known errors. Note that this is only a sanitized subset of the | |||
* errors that the reference implementation generates. */ | ||||
enum { | ||||
_SD_BUS_INVALID_ENDIAN = 0, | ||||
SD_BUS_LITTLE_ENDIAN = 'l', | ||||
SD_BUS_BIG_ENDIAN = 'B', | ||||
#if __BYTE_ORDER == __BIG_ENDIAN | ||||
SD_BUS_NATIVE_ENDIAN = SD_BUS_BIG_ENDIAN, | ||||
SD_BUS_REVERSE_ENDIAN = SD_BUS_LITTLE_ENDIAN | ||||
#else | ||||
SD_BUS_NATIVE_ENDIAN = SD_BUS_LITTLE_ENDIAN, | ||||
SD_BUS_REVERSE_ENDIAN = SD_BUS_BIG_ENDIAN | ||||
#endif | ||||
}; | ||||
/* Flags */ | ||||
enum { | ||||
SD_BUS_MESSAGE_NO_REPLY_EXPECTED = 1, | ||||
SD_BUS_MESSAGE_NO_AUTO_START = 2 | ||||
}; | ||||
/* Header fields */ | ||||
enum { | #define SD_BUS_ERROR_FAILED "org.freedesktop.DBus.Error | |||
_SD_BUS_MESSAGE_HEADER_INVALID = 0, | .Failed" | |||
SD_BUS_MESSAGE_HEADER_PATH, | #define SD_BUS_ERROR_NO_MEMORY "org.freedesktop.DBus.Error | |||
SD_BUS_MESSAGE_HEADER_INTERFACE, | .NoMemory" | |||
SD_BUS_MESSAGE_HEADER_MEMBER, | #define SD_BUS_ERROR_SERVICE_UNKNOWN "org.freedesktop.DBus.Error | |||
SD_BUS_MESSAGE_HEADER_ERROR_NAME, | .ServiceUnknown" | |||
SD_BUS_MESSAGE_HEADER_REPLY_SERIAL, | #define SD_BUS_ERROR_NAME_HAS_NO_OWNER "org.freedesktop.DBus.Error | |||
SD_BUS_MESSAGE_HEADER_DESTINATION, | .NameHasNoOwner" | |||
SD_BUS_MESSAGE_HEADER_SENDER, | #define SD_BUS_ERROR_NO_REPLY "org.freedesktop.DBus.Error | |||
SD_BUS_MESSAGE_HEADER_SIGNATURE, | .NoReply" | |||
SD_BUS_MESSAGE_HEADER_UNIX_FDS, | #define SD_BUS_ERROR_IO_ERROR "org.freedesktop.DBus.Error | |||
_SD_BUS_MESSAGE_HEADER_MAX | .IOError" | |||
}; | #define SD_BUS_ERROR_BAD_ADDRESS "org.freedesktop.DBus.Error | |||
.BadAddress" | ||||
#define SD_BUS_INTROSPECT_DOCTYPE \ | #define SD_BUS_ERROR_NOT_SUPPORTED "org.freedesktop.DBus.Error | |||
"<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspec | .NotSupported" | |||
tion 1.0//EN\"\n" \ | #define SD_BUS_ERROR_LIMITS_EXCEEDED "org.freedesktop.DBus.Error | |||
"\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\ | .LimitsExceeded" | |||
n" | #define SD_BUS_ERROR_ACCESS_DENIED "org.freedesktop.DBus.Error | |||
.AccessDenied" | ||||
#define SD_BUS_INTROSPECT_INTERFACE_PROPERTIES \ | #define SD_BUS_ERROR_AUTH_FAILED "org.freedesktop.DBus.Error | |||
" <interface name=\"org.freedesktop.DBus.Properties\">\n" \ | .AuthFailed" | |||
" <method name=\"Get\">\n" \ | #define SD_BUS_ERROR_NO_SERVER "org.freedesktop.DBus.Error | |||
" <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \ | .NoServer" | |||
" <arg name=\"property\" direction=\"in\" type=\"s\"/>\n" \ | #define SD_BUS_ERROR_TIMEOUT "org.freedesktop.DBus.Error | |||
" <arg name=\"value\" direction=\"out\" type=\"v\"/>\n" \ | .Timeout" | |||
" </method>\n" \ | #define SD_BUS_ERROR_NO_NETWORK "org.freedesktop.DBus.Error | |||
" <method name=\"GetAll\">\n" \ | .NoNetwork" | |||
" <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \ | #define SD_BUS_ERROR_ADDRESS_IN_USE "org.freedesktop.DBus.Error | |||
" <arg name=\"properties\" direction=\"out\" type=\"a{sv}\"/>\n" | .AddressInUse" | |||
\ | #define SD_BUS_ERROR_DISCONNECTED "org.freedesktop.DBus.Error | |||
" </method>\n" \ | .Disconnected" | |||
" <method name=\"Set\">\n" \ | #define SD_BUS_ERROR_INVALID_ARGS "org.freedesktop.DBus.Error | |||
" <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \ | .InvalidArgs" | |||
" <arg name=\"property\" direction=\"in\" type=\"s\"/>\n" \ | #define SD_BUS_ERROR_FILE_NOT_FOUND "org.freedesktop.DBus.Error | |||
" <arg name=\"value\" direction=\"in\" type=\"v\"/>\n" \ | .FileNotFound" | |||
" </method>\n" \ | #define SD_BUS_ERROR_FILE_EXISTS "org.freedesktop.DBus.Error | |||
" <signal name=\"PropertiesChanged\">\n" \ | .FileExists" | |||
" <arg type=\"s\" name=\"interface\"/>\n" \ | #define SD_BUS_ERROR_UNKNOWN_METHOD "org.freedesktop.DBus.Error | |||
" <arg type=\"a{sv}\" name=\"changed_properties\"/>\n" \ | .UnknownMethod" | |||
" <arg type=\"as\" name=\"invalidated_properties\"/>\n" \ | #define SD_BUS_ERROR_UNKNOWN_OBJECT "org.freedesktop.DBus.Error | |||
" </signal>\n" \ | .UnknownObject" | |||
" </interface>\n" | #define SD_BUS_ERROR_UNKNOWN_INTERFACE "org.freedesktop.DBus.Error | |||
.UnknownInterface" | ||||
#define SD_BUS_INTROSPECT_INTERFACE_INTROSPECTABLE \ | #define SD_BUS_ERROR_UNKNOWN_PROPERTY "org.freedesktop.DBus.Error | |||
" <interface name=\"org.freedesktop.DBus.Introspectable\">\n" \ | .UnknownProperty" | |||
" <method name=\"Introspect\">\n" \ | #define SD_BUS_ERROR_PROPERTY_READ_ONLY "org.freedesktop.DBus.Error | |||
" <arg name=\"data\" type=\"s\" direction=\"out\"/>\n" \ | .PropertyReadOnly" | |||
" </method>\n" \ | #define SD_BUS_ERROR_UNIX_PROCESS_ID_UNKNOWN "org.freedesktop.DBus.Error | |||
" </interface>\n" | .UnixProcessIdUnknown" | |||
#define SD_BUS_ERROR_INVALID_SIGNATURE "org.freedesktop.DBus.Error | ||||
#define SD_BUS_INTROSPECT_INTERFACE_PEER \ | .InvalidSignature" | |||
"<interface name=\"org.freedesktop.DBus.Peer\">\n" \ | #define SD_BUS_ERROR_INCONSISTENT_MESSAGE "org.freedesktop.DBus.Error | |||
" <method name=\"Ping\"/>\n" \ | .InconsistentMessage" | |||
" <method name=\"GetMachineId\">\n" \ | #define SD_BUS_ERROR_MATCH_RULE_NOT_FOUND "org.freedesktop.DBus.Error | |||
" <arg type=\"s\" name=\"machine_uuid\" direction=\"out\"/>\n" \ | .MatchRuleNotFound" | |||
" </method>\n" \ | #define SD_BUS_ERROR_MATCH_RULE_INVALID "org.freedesktop.DBus.Error | |||
"</interface>\n" | .MatchRuleInvalid" | |||
#ifdef __cplusplus | _SD_END_DECLARATIONS; | |||
} | ||||
#endif | ||||
#endif | #endif | |||
End of changes. 6 change blocks. | ||||
92 lines changed or deleted | 67 lines changed or added | |||
sd-bus.h | sd-bus.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
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/>. | |||
***/ | ***/ | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <sys/uio.h> | ||||
#include <sd-id128.h> | #include "sd-id128.h" | |||
#include "sd-bus-protocol.h" | #include "sd-event.h" | |||
#include "sd-memfd.h" | #include "sd-memfd.h" | |||
#include "_sd-common.h" | ||||
#ifdef __cplusplus | _SD_BEGIN_DECLARATIONS; | |||
extern "C" { | ||||
#endif | ||||
#ifndef _sd_printf_attr_ | /* Types */ | |||
# if __GNUC__ >= 4 | ||||
# define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) | ||||
# else | ||||
# define _sd_printf_attr_(a,b) | ||||
# endif | ||||
#endif | ||||
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 sd_bus_slot sd_bus_slot; | ||||
typedef struct sd_bus_creds sd_bus_creds; | ||||
typedef struct sd_bus_track sd_bus_track; | ||||
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, sd_bus_message *m, voi | /* Flags */ | |||
d *userdata); | ||||
enum { | ||||
SD_BUS_CREDS_PID = 1ULL << 0, | ||||
SD_BUS_CREDS_PID_STARTTIME = 1ULL << 1, | ||||
SD_BUS_CREDS_TID = 1ULL << 2, | ||||
SD_BUS_CREDS_UID = 1ULL << 3, | ||||
SD_BUS_CREDS_GID = 1ULL << 4, | ||||
SD_BUS_CREDS_COMM = 1ULL << 5, | ||||
SD_BUS_CREDS_TID_COMM = 1ULL << 6, | ||||
SD_BUS_CREDS_EXE = 1ULL << 7, | ||||
SD_BUS_CREDS_CMDLINE = 1ULL << 8, | ||||
SD_BUS_CREDS_CGROUP = 1ULL << 9, | ||||
SD_BUS_CREDS_UNIT = 1ULL << 10, | ||||
SD_BUS_CREDS_USER_UNIT = 1ULL << 11, | ||||
SD_BUS_CREDS_SLICE = 1ULL << 12, | ||||
SD_BUS_CREDS_SESSION = 1ULL << 13, | ||||
SD_BUS_CREDS_OWNER_UID = 1ULL << 14, | ||||
SD_BUS_CREDS_EFFECTIVE_CAPS = 1ULL << 15, | ||||
SD_BUS_CREDS_PERMITTED_CAPS = 1ULL << 16, | ||||
SD_BUS_CREDS_INHERITABLE_CAPS = 1ULL << 17, | ||||
SD_BUS_CREDS_BOUNDING_CAPS = 1ULL << 18, | ||||
SD_BUS_CREDS_SELINUX_CONTEXT = 1ULL << 19, | ||||
SD_BUS_CREDS_AUDIT_SESSION_ID = 1ULL << 20, | ||||
SD_BUS_CREDS_AUDIT_LOGIN_UID = 1ULL << 21, | ||||
SD_BUS_CREDS_UNIQUE_NAME = 1ULL << 22, | ||||
SD_BUS_CREDS_WELL_KNOWN_NAMES = 1ULL << 23, | ||||
SD_BUS_CREDS_CONNECTION_NAME = 1ULL << 24, | ||||
_SD_BUS_CREDS_ALL = (1ULL << 25) -1, | ||||
}; | ||||
enum { | ||||
SD_BUS_NAME_REPLACE_EXISTING = 1ULL << 0, | ||||
SD_BUS_NAME_ALLOW_REPLACEMENT = 1ULL << 1, | ||||
SD_BUS_NAME_QUEUE = 1ULL << 2, | ||||
}; | ||||
/* Callbacks */ | ||||
typedef int (*sd_bus_message_handler_t)(sd_bus *bus, sd_bus_message *m, voi | ||||
d *userdata, sd_bus_error *ret_error); | ||||
typedef int (*sd_bus_property_get_t) (sd_bus *bus, const char *path, const | ||||
char *interface, const char *property, sd_bus_message *reply, void *userdat | ||||
a, sd_bus_error *ret_error); | ||||
typedef int (*sd_bus_property_set_t) (sd_bus *bus, const char *path, const | ||||
char *interface, const char *property, sd_bus_message *value, void *userdat | ||||
a, sd_bus_error *ret_error); | ||||
typedef int (*sd_bus_object_find_t) (sd_bus *bus, const char *path, const c | ||||
har *interface, void *userdata, void **ret_found, sd_bus_error *ret_error); | ||||
typedef int (*sd_bus_node_enumerator_t) (sd_bus *bus, const char *path, voi | ||||
d *userdata, char ***ret_nodes, sd_bus_error *ret_error); | ||||
typedef int (*sd_bus_track_handler_t) (sd_bus_track *track, void *userdata) | ||||
; | ||||
#include "sd-bus-protocol.h" | ||||
#include "sd-bus-vtable.h" | ||||
/* Connections */ | /* Connections */ | |||
int sd_bus_open_system(sd_bus **ret); | int sd_bus_default(sd_bus **ret); | |||
int sd_bus_default_user(sd_bus **ret); | ||||
int sd_bus_default_system(sd_bus **ret); | ||||
int sd_bus_open(sd_bus **ret); | ||||
int sd_bus_open_user(sd_bus **ret); | int sd_bus_open_user(sd_bus **ret); | |||
int sd_bus_open_system(sd_bus **ret); | ||||
int sd_bus_open_system_remote(sd_bus **ret, const char *host); | ||||
int sd_bus_open_system_container(sd_bus **ret, const char *machine); | ||||
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_trusted(sd_bus *bus, int b); | ||||
int sd_bus_set_name(sd_bus *bus, const char *name); | ||||
int sd_bus_set_monitor(sd_bus *bus, int b); | ||||
int sd_bus_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_timestamp(sd_bus *bus, int b); | |||
int sd_bus_negotiate_attach_exe(sd_bus *bus, int b); | int sd_bus_negotiate_creds(sd_bus *bus, uint64_t creds_mask); | |||
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); | |||
int sd_bus_try_close(sd_bus *bus); | ||||
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); | |||
int sd_bus_get_peer_creds(sd_bus *bus, uint64_t creds_mask, sd_bus_creds ** | ||||
int sd_bus_send(sd_bus *bus, sd_bus_message *m, uint64_t *serial); | ret); | |||
int sd_bus_send_with_reply(sd_bus *bus, sd_bus_message *m, sd_bus_message_h | int sd_bus_get_name(sd_bus *bus, const char **name); | |||
andler_t callback, void *userdata, uint64_t usec, uint64_t *serial); | int sd_bus_get_tid(sd_bus *bus, pid_t *tid); | |||
int sd_bus_send_with_reply_cancel(sd_bus *bus, uint64_t serial); | ||||
int sd_bus_send_with_reply_and_block(sd_bus *bus, sd_bus_message *m, uint64 | int sd_bus_send(sd_bus *bus, sd_bus_message *m, uint64_t *cookie); | |||
_t usec, sd_bus_error *error, sd_bus_message **r); | int sd_bus_send_to(sd_bus *bus, sd_bus_message *m, const char *destination, | |||
uint64_t *cookie); | ||||
int sd_bus_call(sd_bus *bus, sd_bus_message *m, uint64_t usec, sd_bus_error | ||||
*ret_error, sd_bus_message **reply); | ||||
int sd_bus_call_async(sd_bus *bus, sd_bus_slot **slot, sd_bus_message *m, s | ||||
d_bus_message_handler_t callback, void *userdata, uint64_t usec); | ||||
int sd_bus_get_fd(sd_bus *bus); | int sd_bus_get_fd(sd_bus *bus); | |||
int sd_bus_get_events(sd_bus *bus); | int sd_bus_get_events(sd_bus *bus); | |||
int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec); | int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec); | |||
int sd_bus_process(sd_bus *bus, sd_bus_message **r); | int sd_bus_process(sd_bus *bus, sd_bus_message **r); | |||
int sd_bus_process_priority(sd_bus *bus, int64_t max_priority, sd_bus_messa ge **r); | ||||
int sd_bus_wait(sd_bus *bus, uint64_t timeout_usec); | int sd_bus_wait(sd_bus *bus, uint64_t timeout_usec); | |||
int sd_bus_flush(sd_bus *bus); | int sd_bus_flush(sd_bus *bus); | |||
sd_bus_message* sd_bus_get_current_message(sd_bus *bus); | ||||
sd_bus_slot* sd_bus_get_current_slot(sd_bus *bus); | ||||
int sd_bus_attach_event(sd_bus *bus, sd_event *e, int priority); | ||||
int sd_bus_detach_event(sd_bus *bus); | ||||
sd_event *sd_bus_get_event(sd_bus *bus); | ||||
int sd_bus_add_filter(sd_bus *bus, sd_bus_message_handler_t callback, void | int sd_bus_add_filter(sd_bus *bus, sd_bus_slot **slot, sd_bus_message_handl | |||
*userdata); | er_t callback, void *userdata); | |||
int sd_bus_remove_filter(sd_bus *bus, sd_bus_message_handler_t callback, vo | int sd_bus_add_match(sd_bus *bus, sd_bus_slot **slot, const char *match, sd | |||
id *userdata); | _bus_message_handler_t callback, void *userdata); | |||
int sd_bus_add_object(sd_bus *bus, sd_bus_slot **slot, const char *path, sd | ||||
_bus_message_handler_t callback, void *userdata); | ||||
int sd_bus_add_fallback(sd_bus *bus, sd_bus_slot **slot, const char *prefix | ||||
, sd_bus_message_handler_t callback, void *userdata); | ||||
int sd_bus_add_object_vtable(sd_bus *bus, sd_bus_slot **slot, const char *p | ||||
ath, const char *interface, const sd_bus_vtable *vtable, void *userdata); | ||||
int sd_bus_add_fallback_vtable(sd_bus *bus, sd_bus_slot **slot, const char | ||||
*prefix, const char *interface, const sd_bus_vtable *vtable, sd_bus_object_ | ||||
find_t find, void *userdata); | ||||
int sd_bus_add_node_enumerator(sd_bus *bus, sd_bus_slot **slot, const char | ||||
*path, sd_bus_node_enumerator_t callback, void *userdata); | ||||
int sd_bus_add_object_manager(sd_bus *bus, sd_bus_slot **slot, const char * | ||||
path); | ||||
int sd_bus_add_object(sd_bus *bus, const char *path, sd_bus_message_handler | /* Slot object */ | |||
_t callback, void *userdata); | ||||
int sd_bus_remove_object(sd_bus *bus, const char *path, sd_bus_message_hand | ||||
ler_t callback, void *userdata); | ||||
int sd_bus_add_fallback(sd_bus *bus, const char *prefix, sd_bus_message_han | sd_bus_slot* sd_bus_slot_ref(sd_bus_slot *slot); | |||
dler_t callback, void *userdata); | sd_bus_slot* sd_bus_slot_unref(sd_bus_slot *slot); | |||
int sd_bus_remove_fallback(sd_bus *bus, const char *prefix, sd_bus_message_ | ||||
handler_t callback, void *userdata); | ||||
int sd_bus_add_match(sd_bus *bus, const char *match, sd_bus_message_handler | sd_bus* sd_bus_slot_get_bus(sd_bus_slot *slot); | |||
_t callback, void *userdata); | ||||
int sd_bus_remove_match(sd_bus *bus, const char *match, sd_bus_message_hand | void *sd_bus_slot_get_userdata(sd_bus_slot *slot); | |||
ler_t callback, void *userdata); | void *sd_bus_slot_set_userdata(sd_bus_slot *slot, void *userdata); | |||
sd_bus_message* sd_bus_slot_get_current_message(sd_bus_slot *slot); | ||||
/* Message object */ | /* Message object */ | |||
int sd_bus_message_new_signal(sd_bus *bus, const char *path, const char *in | int sd_bus_message_new_signal(sd_bus *bus, sd_bus_message **m, const char * | |||
terface, const char *member, sd_bus_message **m); | path, const char *interface, const char *member); | |||
int sd_bus_message_new_method_call(sd_bus *bus, const char *destination, co | int sd_bus_message_new_method_call(sd_bus *bus, sd_bus_message **m, const c | |||
nst char *path, const char *interface, const char *member, sd_bus_message * | har *destination, const char *path, const char *interface, const char *memb | |||
*m); | er); | |||
int sd_bus_message_new_method_return(sd_bus *bus, sd_bus_message *call, sd_ | int sd_bus_message_new_method_return(sd_bus_message *call, sd_bus_message * | |||
bus_message **m); | *m); | |||
int sd_bus_message_new_method_error(sd_bus *bus, sd_bus_message *call, cons | int sd_bus_message_new_method_error(sd_bus_message *call, sd_bus_message ** | |||
t sd_bus_error *e, sd_bus_message **m); | m, const sd_bus_error *e); | |||
int sd_bus_message_new_method_errorf(sd_bus_message *call, sd_bus_message * | ||||
*m, const char *name, const char *format, ...) _sd_printf_(4, 5); | ||||
int sd_bus_message_new_method_errno(sd_bus_message *call, sd_bus_message ** | ||||
m, int error, const sd_bus_error *e); | ||||
int sd_bus_message_new_method_errnof(sd_bus_message *call, sd_bus_message * | ||||
*m, int error, const char *format, ...) _sd_printf_(4, 5); | ||||
sd_bus_message* sd_bus_message_ref(sd_bus_message *m); | sd_bus_message* sd_bus_message_ref(sd_bus_message *m); | |||
sd_bus_message* sd_bus_message_unref(sd_bus_message *m); | sd_bus_message* sd_bus_message_unref(sd_bus_message *m); | |||
int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type); | int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type); | |||
int sd_bus_message_get_serial(sd_bus_message *m, uint64_t *serial); | int sd_bus_message_get_cookie(sd_bus_message *m, uint64_t *cookie); | |||
int sd_bus_message_get_reply_serial(sd_bus_message *m, uint64_t *serial); | int sd_bus_message_get_reply_cookie(sd_bus_message *m, uint64_t *cookie); | |||
int sd_bus_message_get_no_reply(sd_bus_message *m); | int sd_bus_message_get_expect_reply(sd_bus_message *m); | |||
int sd_bus_message_get_auto_start(sd_bus_message *m); | ||||
int sd_bus_message_get_priority(sd_bus_message *m, int64_t *priority); | ||||
const char *sd_bus_message_get_signature(sd_bus_message *m, int complete); | ||||
const char *sd_bus_message_get_path(sd_bus_message *m); | const char *sd_bus_message_get_path(sd_bus_message *m); | |||
const char *sd_bus_message_get_interface(sd_bus_message *m); | const char *sd_bus_message_get_interface(sd_bus_message *m); | |||
const char *sd_bus_message_get_member(sd_bus_message *m); | const char *sd_bus_message_get_member(sd_bus_message *m); | |||
const char *sd_bus_message_get_destination(sd_bus_message *m); | const char *sd_bus_message_get_destination(sd_bus_message *m); | |||
const char *sd_bus_message_get_sender(sd_bus_message *m); | const char *sd_bus_message_get_sender(sd_bus_message *m); | |||
const sd_bus_error *sd_bus_message_get_error(sd_bus_message *m); | const sd_bus_error *sd_bus_message_get_error(sd_bus_message *m); | |||
int sd_bus_message_get_errno(sd_bus_message *m); | ||||
int sd_bus_message_get_monotonic_usec(sd_bus_message *m, uint64_t *usec); | ||||
int sd_bus_message_get_realtime_usec(sd_bus_message *m, uint64_t *usec); | ||||
int sd_bus_message_get_seqnum(sd_bus_message *m, uint64_t* seqnum); | ||||
int sd_bus_message_get_monotonic_timestamp(sd_bus_message *m, uint64_t *use | sd_bus* sd_bus_message_get_bus(sd_bus_message *m); | |||
c); | sd_bus_creds *sd_bus_message_get_creds(sd_bus_message *m); /* do not unref | |||
int sd_bus_message_get_realtime_timestamp(sd_bus_message *m, uint64_t *usec | the result */ | |||
); | ||||
int sd_bus_message_get_uid(sd_bus_message *m, uid_t *uid); | ||||
int sd_bus_message_get_gid(sd_bus_message *m, gid_t *gid); | ||||
int sd_bus_message_get_pid(sd_bus_message *m, pid_t *pid); | ||||
int sd_bus_message_get_tid(sd_bus_message *m, pid_t *tid); | ||||
int sd_bus_message_get_pid_starttime(sd_bus_message *m, uint64_t *usec); | ||||
int sd_bus_message_get_selinux_context(sd_bus_message *m, const char **r); | ||||
int sd_bus_message_get_comm(sd_bus_message *m, const char **r); | ||||
int sd_bus_message_get_tid_comm(sd_bus_message *m, const char **r); | ||||
int sd_bus_message_get_exe(sd_bus_message *m, const char **r); | ||||
int sd_bus_message_get_cgroup(sd_bus_message *m, const char **r); | ||||
int sd_bus_message_get_cmdline(sd_bus_message *m, char ***cmdline); | ||||
int sd_bus_message_get_unit(sd_bus_message *m, const char **unit); | ||||
int sd_bus_message_get_user_unit(sd_bus_message *m, const char **unit); | ||||
int sd_bus_message_get_session(sd_bus_message *m, const char **session); | ||||
int sd_bus_message_get_owner_uid(sd_bus_message *m, uid_t *uid); | ||||
int sd_bus_message_get_audit_sessionid(sd_bus_message *m, uint32_t *session | ||||
id); | ||||
int sd_bus_message_get_audit_loginuid(sd_bus_message *m, uid_t *loginuid); | ||||
int sd_bus_message_has_effective_cap(sd_bus_message *m, int capability); | ||||
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_expect_reply(sd_bus_message *m, int b); | |||
int sd_bus_message_set_auto_start(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_set_priority(sd_bus_message *m, int64_t priority); | ||||
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(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_space(sd_bus_message *m, char type, size_t size, void **ptr); | |||
int sd_bus_message_append_array_iovec(sd_bus_message *m, char type, const s truct iovec *iov, unsigned n); | ||||
int sd_bus_message_append_array_memfd(sd_bus_message *m, char type, sd_memf d *memfd); | 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_space(sd_bus_message *m, size_t size, char **s); | |||
int sd_bus_message_append_string_iovec(sd_bus_message *m, const struct iove c *iov, unsigned n); | ||||
int sd_bus_message_append_string_memfd(sd_bus_message *m, sd_memfd* memfd); | int sd_bus_message_append_string_memfd(sd_bus_message *m, sd_memfd* memfd); | |||
int sd_bus_message_append_strv(sd_bus_message *m, char **l); | ||||
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_copy(sd_bus_message *m, sd_bus_message *source, int all) ; | ||||
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_read_array(sd_bus_message *m, char type, const void **pt r, size_t *size); | |||
int sd_bus_message_read_strv(sd_bus_message *m, char ***l); /* free the res | ||||
ult! */ | ||||
int sd_bus_message_skip(sd_bus_message *m, const char *types); | ||||
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_verify_type(sd_bus_message *m, char type, const char *co | ||||
ntents); | ||||
int sd_bus_message_at_end(sd_bus_message *m, int complete); | ||||
int sd_bus_message_rewind(sd_bus_message *m, int complete); | int sd_bus_message_rewind(sd_bus_message *m, int complete); | |||
/* 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_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_error(sd_bus *bus, sd_bus_message *call, const sd_b | ||||
us_error *e); | ||||
/* Bus management */ | /* Bus management */ | |||
int sd_bus_get_unique_name(sd_bus *bus, const char **unique); | int sd_bus_get_unique_name(sd_bus *bus, const char **unique); | |||
int sd_bus_request_name(sd_bus *bus, const char *name, int flags); | int sd_bus_request_name(sd_bus *bus, const char *name, uint64_t flags); | |||
int sd_bus_release_name(sd_bus *bus, const char *name); | int sd_bus_release_name(sd_bus *bus, const char *name); | |||
int sd_bus_list_names(sd_bus *bus, char ***l); | int sd_bus_list_names(sd_bus *bus, char ***acquired, char ***activatable); | |||
int sd_bus_get_owner(sd_bus *bus, const char *name, char **owner); | /* free the results */ | |||
int sd_bus_get_owner_uid(sd_bus *bus, const char *name, uid_t *uid); | int sd_bus_get_owner(sd_bus *bus, const char *name, uint64_t mask, sd_bus_c | |||
int sd_bus_get_owner_pid(sd_bus *bus, const char *name, pid_t *pid); | reds **creds); /* unref the result! */ | |||
int sd_bus_get_owner_machine_id(sd_bus *bus, const char *name, sd_id128_t * machine); | int sd_bus_get_owner_machine_id(sd_bus *bus, const char *name, sd_id128_t * machine); | |||
/* Convenience calls */ | ||||
int sd_bus_call_method(sd_bus *bus, const char *destination, const char *pa | ||||
th, const char *interface, const char *member, sd_bus_error *ret_error, sd_ | ||||
bus_message **reply, const char *types, ...); | ||||
int sd_bus_get_property(sd_bus *bus, const char *destination, const char *p | ||||
ath, const char *interface, const char *member, sd_bus_error *ret_error, sd | ||||
_bus_message **reply, const char *type); | ||||
int sd_bus_get_property_trivial(sd_bus *bus, const char *destination, const | ||||
char *path, const char *interface, const char *member, sd_bus_error *ret_e | ||||
rror, char type, void *ret_ptr); | ||||
int sd_bus_get_property_string(sd_bus *bus, const char *destination, const | ||||
char *path, const char *interface, const char *member, sd_bus_error *ret_er | ||||
ror, char **ret); /* free the result! */ | ||||
int sd_bus_get_property_strv(sd_bus *bus, const char *destination, const ch | ||||
ar *path, const char *interface, const char *member, sd_bus_error *ret_erro | ||||
r, char ***ret); /* free the result! */ | ||||
int sd_bus_set_property(sd_bus *bus, const char *destination, const char *p | ||||
ath, const char *interface, const char *member, sd_bus_error *ret_error, co | ||||
nst char *ret_type, ...); | ||||
int sd_bus_reply_method_return(sd_bus_message *call, const char *types, ... | ||||
); | ||||
int sd_bus_reply_method_error(sd_bus_message *call, const sd_bus_error *e); | ||||
int sd_bus_reply_method_errorf(sd_bus_message *call, const char *name, cons | ||||
t char *format, ...) _sd_printf_(3, 4); | ||||
int sd_bus_reply_method_errno(sd_bus_message *call, int error, const sd_bus | ||||
_error *e); | ||||
int sd_bus_reply_method_errnof(sd_bus_message *call, int error, const char | ||||
*format, ...) _sd_printf_(3, 4); | ||||
int sd_bus_emit_signal(sd_bus *bus, const char *path, const char *interface | ||||
, const char *member, const char *types, ...); | ||||
int sd_bus_emit_properties_changed_strv(sd_bus *bus, const char *path, cons | ||||
t char *interface, char **names); | ||||
int sd_bus_emit_properties_changed(sd_bus *bus, const char *path, const cha | ||||
r *interface, const char *name, ...) _sd_sentinel_; | ||||
int sd_bus_emit_interfaces_added_strv(sd_bus *bus, const char *path, char * | ||||
*interfaces); | ||||
int sd_bus_emit_interfaces_added(sd_bus *bus, const char *path, const char | ||||
*interface, ...) _sd_sentinel_; | ||||
int sd_bus_emit_interfaces_removed_strv(sd_bus *bus, const char *path, char | ||||
**interfaces); | ||||
int sd_bus_emit_interfaces_removed(sd_bus *bus, const char *path, const cha | ||||
r *interface, ...) _sd_sentinel_; | ||||
int sd_bus_query_sender_creds(sd_bus_message *call, uint64_t mask, sd_bus_c | ||||
reds **creds); | ||||
/* Credential handling */ | ||||
int sd_bus_creds_new_from_pid(sd_bus_creds **ret, pid_t pid, uint64_t creds | ||||
_mask); | ||||
sd_bus_creds *sd_bus_creds_ref(sd_bus_creds *c); | ||||
sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c); | ||||
uint64_t sd_bus_creds_get_mask(const sd_bus_creds *c); | ||||
int sd_bus_creds_get_pid(sd_bus_creds *c, pid_t *pid); | ||||
int sd_bus_creds_get_pid_starttime(sd_bus_creds *c, uint64_t *usec); | ||||
int sd_bus_creds_get_tid(sd_bus_creds *c, pid_t *tid); | ||||
int sd_bus_creds_get_uid(sd_bus_creds *c, uid_t *uid); | ||||
int sd_bus_creds_get_gid(sd_bus_creds *c, gid_t *gid); | ||||
int sd_bus_creds_get_comm(sd_bus_creds *c, const char **comm); | ||||
int sd_bus_creds_get_tid_comm(sd_bus_creds *c, const char **comm); | ||||
int sd_bus_creds_get_exe(sd_bus_creds *c, const char **exe); | ||||
int sd_bus_creds_get_cmdline(sd_bus_creds *c, char ***cmdline); | ||||
int sd_bus_creds_get_cgroup(sd_bus_creds *c, const char **cgroup); | ||||
int sd_bus_creds_get_unit(sd_bus_creds *c, const char **unit); | ||||
int sd_bus_creds_get_user_unit(sd_bus_creds *c, const char **unit); | ||||
int sd_bus_creds_get_slice(sd_bus_creds *c, const char **slice); | ||||
int sd_bus_creds_get_session(sd_bus_creds *c, const char **session); | ||||
int sd_bus_creds_get_owner_uid(sd_bus_creds *c, uid_t *uid); | ||||
int sd_bus_creds_has_effective_cap(sd_bus_creds *c, int capability); | ||||
int sd_bus_creds_has_permitted_cap(sd_bus_creds *c, int capability); | ||||
int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c, int capability); | ||||
int sd_bus_creds_has_bounding_cap(sd_bus_creds *c, int capability); | ||||
int sd_bus_creds_get_selinux_context(sd_bus_creds *c, const char **context) | ||||
; | ||||
int sd_bus_creds_get_audit_session_id(sd_bus_creds *c, uint32_t *sessionid) | ||||
; | ||||
int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c, uid_t *loginuid); | ||||
int sd_bus_creds_get_unique_name(sd_bus_creds *c, const char **name); | ||||
int sd_bus_creds_get_well_known_names(sd_bus_creds *c, char ***names); | ||||
int sd_bus_creds_get_connection_name(sd_bus_creds *c, const char **name); | ||||
/* Error structures */ | /* Error structures */ | |||
#define SD_BUS_ERROR_NULL ((sd_bus_error) {NULL, NULL, 0}) | #define SD_BUS_ERROR_MAKE_CONST(name, message) ((const sd_bus_error) {(name | |||
#define SD_BUS_ERROR_MAKE(name, message) ((sd_bus_error) {(name), (message) | ), (message), 0}) | |||
, 0}) | #define SD_BUS_ERROR_NULL SD_BUS_ERROR_MAKE_CONST(NULL, NULL) | |||
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, | int sd_bus_error_set(sd_bus_error *e, const char *name, const char *message | |||
...) _sd_printf_attr_(3, 0); | ); | |||
void sd_bus_error_set_const(sd_bus_error *e, const char *name, const char * | int sd_bus_error_setf(sd_bus_error *e, const char *name, const char *format | |||
message); | , ...) _sd_printf_(3, 4); | |||
int sd_bus_error_set_const(sd_bus_error *e, const char *name, const char *m | ||||
essage); | ||||
int sd_bus_error_set_errno(sd_bus_error *e, int error); | ||||
int sd_bus_error_set_errnof(sd_bus_error *e, int error, const char *format, | ||||
...) _sd_printf_(3, 4); | ||||
int sd_bus_error_get_errno(const sd_bus_error *e); | ||||
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, | /* Auxiliary macros */ | |||
\ | ||||
(x).bytes[0], (x).bytes[1], (x).bytes[2], (x).bytes[3], | #define SD_BUS_MESSAGE_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[4], (x).bytes[5], (x).bytes[6], (x).bytes[7], | |||
\ | ||||
(x).bytes[8], (x).bytes[9], (x).bytes[10], (x).bytes[11], \ | (x).bytes[8], (x).bytes[9], (x).bytes[10], (x).bytes[11], \ | |||
(x).bytes[12], (x).bytes[13], (x).bytes[14], (x).bytes[15] | (x).bytes[12], (x).bytes[13], (x).bytes[14], (x).bytes[15] | |||
#ifdef __cplusplus | #define SD_BUS_MESSAGE_READ_ID128(x) 16, \ | |||
} | &(x).bytes[0], &(x).bytes[1], &(x).bytes[2], &(x).bytes[ | |||
#endif | 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] | ||||
/* Label escaping */ | ||||
int sd_bus_path_encode(const char *prefix, const char *external_id, char ** | ||||
ret_path); | ||||
int sd_bus_path_decode(const char *path, const char *prefix, char **ret_ext | ||||
ernal_id); | ||||
/* Tracking peers */ | ||||
int sd_bus_track_new(sd_bus *bus, sd_bus_track **track, sd_bus_track_handle | ||||
r_t handler, void *userdata); | ||||
sd_bus_track* sd_bus_track_ref(sd_bus_track *track); | ||||
sd_bus_track* sd_bus_track_unref(sd_bus_track *track); | ||||
sd_bus* sd_bus_track_get_bus(sd_bus_track *track); | ||||
void *sd_bus_track_get_userdata(sd_bus_track *track); | ||||
void *sd_bus_track_set_userdata(sd_bus_track *track, void *userdata); | ||||
int sd_bus_track_add_sender(sd_bus_track *track, sd_bus_message *m); | ||||
int sd_bus_track_remove_sender(sd_bus_track *track, sd_bus_message *m); | ||||
int sd_bus_track_add_name(sd_bus_track *track, const char *name); | ||||
int sd_bus_track_remove_name(sd_bus_track *track, const char *name); | ||||
unsigned sd_bus_track_count(sd_bus_track *track); | ||||
const char* sd_bus_track_contains(sd_bus_track *track, const char *names); | ||||
const char* sd_bus_track_first(sd_bus_track *track); | ||||
const char* sd_bus_track_next(sd_bus_track *track); | ||||
_SD_END_DECLARATIONS; | ||||
#endif | #endif | |||
End of changes. 41 change blocks. | ||||
115 lines changed or deleted | 318 lines changed or added | |||
sd-daemon.h | sd-daemon.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foosddaemonhfoo | #ifndef foosddaemonhfoo | |||
#define foosddaemonhfoo | #define foosddaemonhfoo | |||
/*** | /*** | |||
Copyright 2010 Lennart Poettering | This file is part of systemd. | |||
Permission is hereby granted, free of charge, to any person | Copyright 2013 Lennart Poettering | |||
obtaining a copy of this software and associated documentation files | ||||
(the "Software"), to deal in the Software without restriction, | systemd is free software; you can redistribute it and/or modify it | |||
including without limitation the rights to use, copy, modify, merge, | under the terms of the GNU Lesser General Public License as published by | |||
publish, distribute, sublicense, and/or sell copies of the Software, | the Free Software Foundation; either version 2.1 of the License, or | |||
and to permit persons to whom the Software is furnished to do so, | (at your option) any later version. | |||
subject to the following conditions: | ||||
systemd is distributed in the hope that it will be useful, but | ||||
The above copyright notice and this permission notice shall be | WITHOUT ANY WARRANTY; without even the implied warranty of | |||
included in all copies or substantial portions of the Software. | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
Lesser General Public License for more details. | ||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | You should have received a copy of the GNU Lesser General Public License | |||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||||
SOFTWARE. | ||||
***/ | ***/ | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#ifdef __cplusplus | #include "_sd-common.h" | |||
extern "C" { | ||||
#endif | ||||
/* | _SD_BEGIN_DECLARATIONS; | |||
Reference implementation of a few systemd related interfaces for | ||||
writing daemons. These interfaces are trivial to implement. To | ||||
simplify porting we provide this reference implementation. | ||||
Applications are welcome to reimplement the algorithms described | ||||
here if they do not want to include these two source files. | ||||
/* | ||||
The following functionality is provided: | The following functionality is provided: | |||
- Support for logging with log levels on stderr | - Support for logging with log levels on stderr | |||
- File descriptor passing for socket-based activation | - File descriptor passing for socket-based activation | |||
- Daemon startup and status notification | - Daemon startup and status notification | |||
- Detection of systemd boots | - Detection of systemd boots | |||
You may compile this with -DDISABLE_SYSTEMD to disable systemd | ||||
support. This makes all those calls NOPs that are directly related to | ||||
systemd (i.e. only sd_is_xxx() will stay useful). | ||||
Since this is drop-in code we don't want any of our symbols to be | ||||
exported in any case. Hence we declare hidden visibility for all of | ||||
them. | ||||
You may find an up-to-date version of these source files online: | ||||
http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h | ||||
http://cgit.freedesktop.org/systemd/systemd/plain/src/libsystemd-daemon/s | ||||
d-daemon.c | ||||
This should compile on non-Linux systems, too, but with the | ||||
exception of the sd_is_xxx() calls all functions will become NOPs. | ||||
See sd-daemon(3) for more information. | See sd-daemon(3) for more information. | |||
*/ | */ | |||
#ifndef _sd_printf_attr_ | ||||
# if __GNUC__ >= 4 | ||||
# define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) | ||||
# else | ||||
# define _sd_printf_attr_(a,b) | ||||
# endif | ||||
#endif | ||||
/* | /* | |||
Log levels for usage on stderr: | Log levels for usage on stderr: | |||
fprintf(stderr, SD_NOTICE "Hello World!\n"); | fprintf(stderr, SD_NOTICE "Hello World!\n"); | |||
This is similar to printk() usage in the kernel. | This is similar to printk() usage in the kernel. | |||
*/ | */ | |||
#define SD_EMERG "<0>" /* system is unusable */ | #define SD_EMERG "<0>" /* system is unusable */ | |||
#define SD_ALERT "<1>" /* action must be taken immediately */ | #define SD_ALERT "<1>" /* action must be taken immediately */ | |||
#define SD_CRIT "<2>" /* critical conditions */ | #define SD_CRIT "<2>" /* critical conditions */ | |||
skipping to change at line 189 | skipping to change at line 154 | |||
See sd_is_socket_unix(3) for more information. | See sd_is_socket_unix(3) for more information. | |||
*/ | */ | |||
int sd_is_socket_unix(int fd, int type, int listening, const char *path, si ze_t length); | int sd_is_socket_unix(int fd, int type, int listening, const char *path, si ze_t length); | |||
/* | /* | |||
Helper call for identifying a passed file descriptor. Returns 1 if | Helper call for identifying a passed file descriptor. Returns 1 if | |||
the file descriptor is a POSIX Message Queue of the specified name, | the file descriptor is a POSIX Message Queue of the specified name, | |||
0 otherwise. If path is NULL a message queue name check is not | 0 otherwise. If path is NULL a message queue name check is not | |||
done. Returns a negative errno style error code on failure. | done. Returns a negative errno style error code on failure. | |||
See sd_is_mq(3) for more information. | ||||
*/ | */ | |||
int sd_is_mq(int fd, const char *path); | int sd_is_mq(int fd, const char *path); | |||
/* | /* | |||
Informs systemd about changed daemon state. This takes a number of | Informs systemd about changed daemon state. This takes a number of | |||
newline separated environment-style variable assignments in a | newline separated environment-style variable assignments in a | |||
string. The following variables are known: | string. The following variables are known: | |||
READY=1 Tells systemd that daemon startup is finished (only | READY=1 Tells systemd that daemon startup is finished (only | |||
relevant for services of Type=notify). The passed | relevant for services of Type=notify). The passed | |||
skipping to change at line 223 | skipping to change at line 190 | |||
BUSERROR=... If a daemon fails, the D-Bus error-style error | BUSERROR=... If a daemon fails, the D-Bus error-style error | |||
code. Example: "BUSERROR=org.freedesktop.DBus.Error.Timed Out" | code. Example: "BUSERROR=org.freedesktop.DBus.Error.Timed Out" | |||
MAINPID=... The main pid of a daemon, in case systemd did not | MAINPID=... The main pid of a daemon, in case systemd did not | |||
fork off the process itself. Example: "MAINPID=4711" | fork off the process itself. Example: "MAINPID=4711" | |||
WATCHDOG=1 Tells systemd to update the watchdog timestamp. | WATCHDOG=1 Tells systemd to update the watchdog timestamp. | |||
Services using this feature should do this in | Services using this feature should do this in | |||
regular intervals. A watchdog framework can use the | regular intervals. A watchdog framework can use the | |||
timestamps to detect failed services. | timestamps to detect failed services. Also see | |||
sd_watchdog_enabled() below. | ||||
Daemons can choose to send additional variables. However, it is | Daemons can choose to send additional variables. However, it is | |||
recommended to prefix variable names not listed above with X_. | recommended to prefix variable names not listed above with X_. | |||
Returns a negative errno-style error code on failure. Returns > 0 | Returns a negative errno-style error code on failure. Returns > 0 | |||
if systemd could be notified, 0 if it couldn't possibly because | if systemd could be notified, 0 if it couldn't possibly because | |||
systemd is not running. | systemd is not running. | |||
Example: When a daemon finished starting up, it could issue this | Example: When a daemon finished starting up, it could issue this | |||
call to notify systemd about it: | call to notify systemd about it: | |||
skipping to change at line 263 | skipping to change at line 231 | |||
Example 2: A daemon could send the following shortly before | Example 2: A daemon could send the following shortly before | |||
exiting, on failure: | exiting, on failure: | |||
sd_notifyf(0, "STATUS=Failed to start up: %s\n" | sd_notifyf(0, "STATUS=Failed to start up: %s\n" | |||
"ERRNO=%i", | "ERRNO=%i", | |||
strerror(errno), | strerror(errno), | |||
errno); | errno); | |||
See sd_notifyf(3) for more information. | See sd_notifyf(3) for more information. | |||
*/ | */ | |||
int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_a | int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_( | |||
ttr_(2,3); | 2,3); | |||
/* | ||||
Similar to sd_notify(), but send the message on behalf of another | ||||
process, if the appropriate permissions are available. | ||||
*/ | ||||
int sd_pid_notify(pid_t pid, int unset_environment, const char *state); | ||||
/* | ||||
Similar to sd_notifyf(), but send the message on behalf of another | ||||
process, if the appropriate permissions are available. | ||||
*/ | ||||
int sd_pid_notifyf(pid_t pid, int unset_environment, const char *format, .. | ||||
.) _sd_printf_(3,4); | ||||
/* | /* | |||
Returns > 0 if the system was booted with systemd. Returns < 0 on | Returns > 0 if the system was booted with systemd. Returns < 0 on | |||
error. Returns 0 if the system was not booted with systemd. Note | error. Returns 0 if the system was not booted with systemd. Note | |||
that all of the functions above handle non-systemd boots just | that all of the functions above handle non-systemd boots just | |||
fine. You should NOT protect them with a call to this function. Also | fine. You should NOT protect them with a call to this function. Also | |||
note that this function checks whether the system, not the user | note that this function checks whether the system, not the user | |||
session is controlled by systemd. However the functions above work | session is controlled by systemd. However the functions above work | |||
for both user and system services. | for both user and system services. | |||
See sd_booted(3) for more information. | See sd_booted(3) for more information. | |||
*/ | */ | |||
int sd_booted(void); | int sd_booted(void); | |||
#ifdef __cplusplus | /* | |||
} | Returns > 0 if the service manager expects watchdog keep-alive | |||
#endif | events to be sent regularly via sd_notify(0, "WATCHDOG=1"). Returns | |||
0 if it does not expect this. If the usec argument is non-NULL | ||||
returns the watchdog timeout in µs after which the service manager | ||||
will act on a process that has not sent a watchdog keep alive | ||||
message. This function is useful to implement services that | ||||
recognize automatically if they are being run under supervision of | ||||
systemd with WatchdogSec= set. It is recommended for clients to | ||||
generate keep-alive pings via sd_notify(0, "WATCHDOG=1") every half | ||||
of the returned time. | ||||
See sd_watchdog_enabled(3) for more information. | ||||
*/ | ||||
int sd_watchdog_enabled(int unset_environment, uint64_t *usec); | ||||
_SD_END_DECLARATIONS; | ||||
#endif | #endif | |||
End of changes. 11 change blocks. | ||||
60 lines changed or deleted | 54 lines changed or added | |||
sd-id128.h | sd-id128.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooid128hfoo | #ifndef foosdid128hfoo | |||
#define fooid128hfoo | #define foosdid128hfoo | |||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2011 Lennart Poettering | Copyright 2011 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. | |||
skipping to change at line 28 | skipping to change at line 28 | |||
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/>. | |||
***/ | ***/ | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <string.h> | #include <string.h> | |||
#ifdef __cplusplus | #include "_sd-common.h" | |||
extern "C" { | ||||
#endif | _SD_BEGIN_DECLARATIONS; | |||
/* 128 Bit ID APIs. See sd-id128(3) for more information. */ | /* 128-bit ID APIs. See sd-id128(3) for more information. */ | |||
typedef union sd_id128 sd_id128_t; | typedef union sd_id128 sd_id128_t; | |||
union sd_id128 { | union sd_id128 { | |||
uint8_t bytes[16]; | uint8_t bytes[16]; | |||
uint64_t qwords[2]; | uint64_t qwords[2]; | |||
}; | }; | |||
char *sd_id128_to_string(sd_id128_t id, char s[33]); | #define SD_ID128_STRING_MAX 33 | |||
char *sd_id128_to_string(sd_id128_t id, char s[SD_ID128_STRING_MAX]); | ||||
int sd_id128_from_string(const char *s, sd_id128_t *ret); | int sd_id128_from_string(const char *s, sd_id128_t *ret); | |||
int sd_id128_randomize(sd_id128_t *ret); | int sd_id128_randomize(sd_id128_t *ret); | |||
int sd_id128_get_machine(sd_id128_t *ret); | int sd_id128_get_machine(sd_id128_t *ret); | |||
int sd_id128_get_boot(sd_id128_t *ret); | int sd_id128_get_boot(sd_id128_t *ret); | |||
#define SD_ID128_MAKE(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12 , v13, v14, v15) \ | #define SD_ID128_MAKE(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12 , v13, v14, v15) \ | |||
((sd_id128_t) { .bytes = { 0x##v0, 0x##v1, 0x##v2, 0x##v3, 0x##v4, 0x##v5, 0x##v6, 0x##v7, \ | ((const sd_id128_t) { .bytes = { 0x##v0, 0x##v1, 0x##v2, 0x##v3, 0x ##v4, 0x##v5, 0x##v6, 0x##v7, \ | |||
0x##v8, 0x##v9, 0x##v10, 0x##v11, 0x##v1 2, 0x##v13, 0x##v14, 0x##v15 }}) | 0x##v8, 0x##v9, 0x##v10, 0x##v11, 0x##v1 2, 0x##v13, 0x##v14, 0x##v15 }}) | |||
#define SD_ID128_ARRAY(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v1 | ||||
2, v13, v14, v15) \ | ||||
{ .bytes = { 0x##v0, 0x##v1, 0x##v2, 0x##v3, 0x##v4, 0x##v5, 0x##v6 | ||||
, 0x##v7, \ | ||||
0x##v8, 0x##v9, 0x##v10, 0x##v11, 0x##v12, 0x##v13, 0x | ||||
##v14, 0x##v15 }} | ||||
/* Note that SD_ID128_FORMAT_VAL will evaluate the passed argument 16 | /* Note that SD_ID128_FORMAT_VAL will evaluate the passed argument 16 | |||
* times. It is hence not a good idea to call this macro with an | * times. It is hence not a good idea to call this macro with an | |||
* expensive function as paramater or an expression with side | * expensive function as paramater or an expression with side | |||
* effects */ | * effects */ | |||
#define SD_ID128_FORMAT_STR "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%0 2x%02x%02x%02x%02x" | #define SD_ID128_FORMAT_STR "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%0 2x%02x%02x%02x%02x" | |||
#define SD_ID128_FORMAT_VAL(x) (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).byt es[8], (x).bytes[9], (x).bytes[10], (x).bytes[11], (x).bytes[12], (x).bytes [13], (x).bytes[14], (x).bytes[15] | #define SD_ID128_FORMAT_VAL(x) (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).byt es[8], (x).bytes[9], (x).bytes[10], (x).bytes[11], (x).bytes[12], (x).bytes [13], (x).bytes[14], (x).bytes[15] | |||
#define SD_ID128_CONST_STR(x) \ | #define SD_ID128_CONST_STR(x) \ | |||
((char[33]) { \ | ((const char[SD_ID128_STRING_MAX]) { \ | |||
((x).bytes[0] >> 4) >= 10 ? 'a' + ((x).bytes[0] >> 4) - 10 : '0' + ((x).bytes[0] >> 4), \ | ((x).bytes[0] >> 4) >= 10 ? 'a' + ((x).bytes[0] >> 4) - 10 : '0' + ((x).bytes[0] >> 4), \ | |||
((x).bytes[0] & 15) >= 10 ? 'a' + ((x).bytes[0] & 15) - 10 : '0' + ((x).bytes[0] & 15), \ | ((x).bytes[0] & 15) >= 10 ? 'a' + ((x).bytes[0] & 15) - 10 : '0' + ((x).bytes[0] & 15), \ | |||
((x).bytes[1] >> 4) >= 10 ? 'a' + ((x).bytes[1] >> 4) - 10 : '0' + ((x).bytes[1] >> 4), \ | ((x).bytes[1] >> 4) >= 10 ? 'a' + ((x).bytes[1] >> 4) - 10 : '0' + ((x).bytes[1] >> 4), \ | |||
((x).bytes[1] & 15) >= 10 ? 'a' + ((x).bytes[1] & 15) - 10 : '0' + ((x).bytes[1] & 15), \ | ((x).bytes[1] & 15) >= 10 ? 'a' + ((x).bytes[1] & 15) - 10 : '0' + ((x).bytes[1] & 15), \ | |||
((x).bytes[2] >> 4) >= 10 ? 'a' + ((x).bytes[2] >> 4) - 10 : '0' + ((x).bytes[2] >> 4), \ | ((x).bytes[2] >> 4) >= 10 ? 'a' + ((x).bytes[2] >> 4) - 10 : '0' + ((x).bytes[2] >> 4), \ | |||
((x).bytes[2] & 15) >= 10 ? 'a' + ((x).bytes[2] & 15) - 10 : '0' + ((x).bytes[2] & 15), \ | ((x).bytes[2] & 15) >= 10 ? 'a' + ((x).bytes[2] & 15) - 10 : '0' + ((x).bytes[2] & 15), \ | |||
((x).bytes[3] >> 4) >= 10 ? 'a' + ((x).bytes[3] >> 4) - 10 : '0' + ((x).bytes[3] >> 4), \ | ((x).bytes[3] >> 4) >= 10 ? 'a' + ((x).bytes[3] >> 4) - 10 : '0' + ((x).bytes[3] >> 4), \ | |||
((x).bytes[3] & 15) >= 10 ? 'a' + ((x).bytes[3] & 15) - 10 : '0' + ((x).bytes[3] & 15), \ | ((x).bytes[3] & 15) >= 10 ? 'a' + ((x).bytes[3] & 15) - 10 : '0' + ((x).bytes[3] & 15), \ | |||
((x).bytes[4] >> 4) >= 10 ? 'a' + ((x).bytes[4] >> 4) - 10 : '0' + ((x).bytes[4] >> 4), \ | ((x).bytes[4] >> 4) >= 10 ? 'a' + ((x).bytes[4] >> 4) - 10 : '0' + ((x).bytes[4] >> 4), \ | |||
((x).bytes[4] & 15) >= 10 ? 'a' + ((x).bytes[4] & 15) - 10 : '0' + ((x).bytes[4] & 15), \ | ((x).bytes[4] & 15) >= 10 ? 'a' + ((x).bytes[4] & 15) - 10 : '0' + ((x).bytes[4] & 15), \ | |||
skipping to change at line 99 | skipping to change at line 105 | |||
((x).bytes[12] >> 4) >= 10 ? 'a' + ((x).bytes[12] >> 4) - 1 0 : '0' + ((x).bytes[12] >> 4), \ | ((x).bytes[12] >> 4) >= 10 ? 'a' + ((x).bytes[12] >> 4) - 1 0 : '0' + ((x).bytes[12] >> 4), \ | |||
((x).bytes[12] & 15) >= 10 ? 'a' + ((x).bytes[12] & 15) - 1 0 : '0' + ((x).bytes[12] & 15), \ | ((x).bytes[12] & 15) >= 10 ? 'a' + ((x).bytes[12] & 15) - 1 0 : '0' + ((x).bytes[12] & 15), \ | |||
((x).bytes[13] >> 4) >= 10 ? 'a' + ((x).bytes[13] >> 4) - 1 0 : '0' + ((x).bytes[13] >> 4), \ | ((x).bytes[13] >> 4) >= 10 ? 'a' + ((x).bytes[13] >> 4) - 1 0 : '0' + ((x).bytes[13] >> 4), \ | |||
((x).bytes[13] & 15) >= 10 ? 'a' + ((x).bytes[13] & 15) - 1 0 : '0' + ((x).bytes[13] & 15), \ | ((x).bytes[13] & 15) >= 10 ? 'a' + ((x).bytes[13] & 15) - 1 0 : '0' + ((x).bytes[13] & 15), \ | |||
((x).bytes[14] >> 4) >= 10 ? 'a' + ((x).bytes[14] >> 4) - 1 0 : '0' + ((x).bytes[14] >> 4), \ | ((x).bytes[14] >> 4) >= 10 ? 'a' + ((x).bytes[14] >> 4) - 1 0 : '0' + ((x).bytes[14] >> 4), \ | |||
((x).bytes[14] & 15) >= 10 ? 'a' + ((x).bytes[14] & 15) - 1 0 : '0' + ((x).bytes[14] & 15), \ | ((x).bytes[14] & 15) >= 10 ? 'a' + ((x).bytes[14] & 15) - 1 0 : '0' + ((x).bytes[14] & 15), \ | |||
((x).bytes[15] >> 4) >= 10 ? 'a' + ((x).bytes[15] >> 4) - 1 0 : '0' + ((x).bytes[15] >> 4), \ | ((x).bytes[15] >> 4) >= 10 ? 'a' + ((x).bytes[15] >> 4) - 1 0 : '0' + ((x).bytes[15] >> 4), \ | |||
((x).bytes[15] & 15) >= 10 ? 'a' + ((x).bytes[15] & 15) - 1 0 : '0' + ((x).bytes[15] & 15), \ | ((x).bytes[15] & 15) >= 10 ? 'a' + ((x).bytes[15] & 15) - 1 0 : '0' + ((x).bytes[15] & 15), \ | |||
0 }) | 0 }) | |||
static inline int sd_id128_equal(sd_id128_t a, sd_id128_t b) { | _sd_pure_ static inline int sd_id128_equal(sd_id128_t a, sd_id128_t b) { | |||
return memcmp(&a, &b, 16) == 0; | return memcmp(&a, &b, 16) == 0; | |||
} | } | |||
#define SD_ID128_NULL ((sd_id128_t) { .qwords = { 0, 0 }}) | #define SD_ID128_NULL ((const sd_id128_t) { .qwords = { 0, 0 }}) | |||
#ifdef __cplusplus | _SD_END_DECLARATIONS; | |||
} | ||||
#endif | ||||
#endif | #endif | |||
End of changes. 10 change blocks. | ||||
14 lines changed or deleted | 21 lines changed or added | |||
sd-journal.h | sd-journal.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foojournalhfoo | #ifndef foosdjournalhfoo | |||
#define foojournalhfoo | #define foosdjournalhfoo | |||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2011 Lennart Poettering | Copyright 2011 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. | |||
skipping to change at line 31 | skipping to change at line 31 | |||
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 <stdarg.h> | #include <stdarg.h> | |||
#include <sys/uio.h> | #include <sys/uio.h> | |||
#include <syslog.h> | #include <syslog.h> | |||
#include <systemd/sd-id128.h> | #include "sd-id128.h" | |||
#include "_sd-common.h" | ||||
#ifdef __cplusplus | ||||
extern "C" { | ||||
#endif | ||||
#ifndef _sd_printf_attr_ | ||||
# if __GNUC__ >= 4 | ||||
# define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) | ||||
# else | ||||
# define _sd_printf_attr_(a,b) | ||||
# endif | ||||
#endif | ||||
#ifndef _sd_sentinel_attr_ | ||||
# define _sd_sentinel_attr_ __attribute__((sentinel)) | ||||
#endif | ||||
/* Journal APIs. See sd-journal(3) for more information. */ | /* Journal APIs. See sd-journal(3) for more information. */ | |||
_SD_BEGIN_DECLARATIONS; | ||||
/* Write to daemon */ | /* Write to daemon */ | |||
int sd_journal_print(int priority, const char *format, ...) _sd_printf_attr | int sd_journal_print(int priority, const char *format, ...) _sd_printf_(2, | |||
_(2, 3); | 3); | |||
int sd_journal_printv(int priority, const char *format, va_list ap) _sd_pri | int sd_journal_printv(int priority, const char *format, va_list ap) _sd_pri | |||
ntf_attr_(2, 0); | ntf_(2, 0); | |||
int sd_journal_send(const char *format, ...) _sd_printf_attr_(1, 0) _sd_sen | int sd_journal_send(const char *format, ...) _sd_printf_(1, 0) _sd_sentinel | |||
tinel_attr_; | _; | |||
int sd_journal_sendv(const struct iovec *iov, int n); | int sd_journal_sendv(const struct iovec *iov, int n); | |||
int sd_journal_perror(const char *message); | int sd_journal_perror(const char *message); | |||
/* Used by the macros below. Don't call this directly. */ | /* Used by the macros below. You probably don't want to call this directly. | |||
int sd_journal_print_with_location(int priority, const char *file, const ch | */ | |||
ar *line, const char *func, const char *format, ...) _sd_printf_attr_(5, 6) | int sd_journal_print_with_location(int priority, const char *file, const ch | |||
; | ar *line, const char *func, const char *format, ...) _sd_printf_(5, 6); | |||
int sd_journal_printv_with_location(int priority, const char *file, const c | int sd_journal_printv_with_location(int priority, const char *file, const c | |||
har *line, const char *func, const char *format, va_list ap) _sd_printf_att | har *line, const char *func, const char *format, va_list ap) _sd_printf_(5, | |||
r_(5, 0); | 0); | |||
int sd_journal_send_with_location(const char *file, const char *line, const | int sd_journal_send_with_location(const char *file, const char *line, const | |||
char *func, const char *format, ...) _sd_printf_attr_(4, 0) _sd_sentinel_a | char *func, const char *format, ...) _sd_printf_(4, 0) _sd_sentinel_; | |||
ttr_; | ||||
int sd_journal_sendv_with_location(const char *file, const char *line, cons t char *func, const struct iovec *iov, int n); | int sd_journal_sendv_with_location(const char *file, const char *line, cons t char *func, const struct iovec *iov, int n); | |||
int sd_journal_perror_with_location(const char *file, const char *line, con st char *func, const char *message); | int sd_journal_perror_with_location(const char *file, const char *line, con st char *func, const char *message); | |||
/* implicitly add code location to messages sent, if this is enabled */ | /* implicitly add code location to messages sent, if this is enabled */ | |||
#ifndef SD_JOURNAL_SUPPRESS_LOCATION | #ifndef SD_JOURNAL_SUPPRESS_LOCATION | |||
#define _sd_XSTRINGIFY(x) #x | #define sd_journal_print(priority, ...) sd_journal_print_with_location(prio | |||
#define _sd_STRINGIFY(x) _sd_XSTRINGIFY(x) | rity, "CODE_FILE=" __FILE__, "CODE_LINE=" _SD_STRINGIFY(__LINE__), __func__ | |||
, __VA_ARGS__) | ||||
#define sd_journal_print(priority, ...) sd_journal_print_with_location(prio | #define sd_journal_printv(priority, format, ap) sd_journal_printv_with_loca | |||
rity, "CODE_FILE=" __FILE__, "CODE_LINE=" _sd_STRINGIFY(__LINE__), __func__ | tion(priority, "CODE_FILE=" __FILE__, "CODE_LINE=" _SD_STRINGIFY(__LINE__), | |||
, __VA_ARGS__) | __func__, format, ap) | |||
#define sd_journal_printv(priority, format, ap) sd_journal_printv_with_loca | #define sd_journal_send(...) sd_journal_send_with_location("CODE_FILE=" __F | |||
tion(priority, "CODE_FILE=" __FILE__, "CODE_LINE=" _sd_STRINGIFY(__LINE__), | ILE__, "CODE_LINE=" _SD_STRINGIFY(__LINE__), __func__, __VA_ARGS__) | |||
__func__, format, ap) | #define sd_journal_sendv(iovec, n) sd_journal_sendv_with_location("CODE_FIL | |||
#define sd_journal_send(...) sd_journal_send_with_location("CODE_FILE=" __F | E=" __FILE__, "CODE_LINE=" _SD_STRINGIFY(__LINE__), __func__, iovec, n) | |||
ILE__, "CODE_LINE=" _sd_STRINGIFY(__LINE__), __func__, __VA_ARGS__) | #define sd_journal_perror(message) sd_journal_perror_with_location("CODE_FI | |||
#define sd_journal_sendv(iovec, n) sd_journal_sendv_with_location("CODE_FIL | LE=" __FILE__, "CODE_LINE=" _SD_STRINGIFY(__LINE__), __func__, message) | |||
E=" __FILE__, "CODE_LINE=" _sd_STRINGIFY(__LINE__), __func__, iovec, n) | ||||
#define sd_journal_perror(message) sd_journal_perror_with_location("CODE_FI | ||||
LE=" __FILE__, "CODE_LINE=" _sd_STRINGIFY(__LINE__), __func__, message) | ||||
#endif | #endif | |||
int sd_journal_stream_fd(const char *identifier, int priority, int level_pr efix); | int sd_journal_stream_fd(const char *identifier, int priority, int level_pr efix); | |||
/* Browse journal stream */ | /* Browse journal stream */ | |||
typedef struct sd_journal sd_journal; | typedef struct sd_journal sd_journal; | |||
/* Open flags */ | /* Open flags */ | |||
enum { | enum { | |||
SD_JOURNAL_LOCAL_ONLY = 1, | SD_JOURNAL_LOCAL_ONLY = 1, | |||
SD_JOURNAL_RUNTIME_ONLY = 2, | SD_JOURNAL_RUNTIME_ONLY = 2, | |||
SD_JOURNAL_SYSTEM = 4, | SD_JOURNAL_SYSTEM = 4, | |||
SD_JOURNAL_SYSTEM_ONLY = SD_JOURNAL_SYSTEM, /* deprecated */ | ||||
SD_JOURNAL_CURRENT_USER = 8, | SD_JOURNAL_CURRENT_USER = 8, | |||
SD_JOURNAL_SYSTEM_ONLY = SD_JOURNAL_SYSTEM, /* deprecated name */ | ||||
}; | }; | |||
/* Wakeup event types */ | /* Wakeup event types */ | |||
enum { | enum { | |||
SD_JOURNAL_NOP, | SD_JOURNAL_NOP, | |||
SD_JOURNAL_APPEND, | SD_JOURNAL_APPEND, | |||
SD_JOURNAL_INVALIDATE | SD_JOURNAL_INVALIDATE | |||
}; | }; | |||
int sd_journal_open(sd_journal **ret, int flags); | int sd_journal_open(sd_journal **ret, int flags); | |||
int sd_journal_open_directory(sd_journal **ret, const char *path, int flags ); | int sd_journal_open_directory(sd_journal **ret, const char *path, int flags ); | |||
int sd_journal_open_files(sd_journal **ret, const char **paths, int flags); | int sd_journal_open_files(sd_journal **ret, const char **paths, int flags); | |||
int sd_journal_open_container(sd_journal **ret, const char *machine, int fl ags); | ||||
void sd_journal_close(sd_journal *j); | void sd_journal_close(sd_journal *j); | |||
int sd_journal_previous(sd_journal *j); | int sd_journal_previous(sd_journal *j); | |||
int sd_journal_next(sd_journal *j); | int sd_journal_next(sd_journal *j); | |||
int sd_journal_previous_skip(sd_journal *j, uint64_t skip); | int sd_journal_previous_skip(sd_journal *j, uint64_t skip); | |||
int sd_journal_next_skip(sd_journal *j, uint64_t skip); | int sd_journal_next_skip(sd_journal *j, uint64_t skip); | |||
int sd_journal_get_realtime_usec(sd_journal *j, uint64_t *ret); | int sd_journal_get_realtime_usec(sd_journal *j, uint64_t *ret); | |||
int sd_journal_get_monotonic_usec(sd_journal *j, uint64_t *ret, sd_id128_t *ret_boot_id); | int sd_journal_get_monotonic_usec(sd_journal *j, uint64_t *ret, sd_id128_t *ret_boot_id); | |||
skipping to change at line 153 | skipping to change at line 139 | |||
void sd_journal_restart_unique(sd_journal *j); | void sd_journal_restart_unique(sd_journal *j); | |||
int sd_journal_get_fd(sd_journal *j); | int sd_journal_get_fd(sd_journal *j); | |||
int sd_journal_get_events(sd_journal *j); | int sd_journal_get_events(sd_journal *j); | |||
int sd_journal_get_timeout(sd_journal *j, uint64_t *timeout_usec); | int sd_journal_get_timeout(sd_journal *j, uint64_t *timeout_usec); | |||
int sd_journal_process(sd_journal *j); | int sd_journal_process(sd_journal *j); | |||
int sd_journal_wait(sd_journal *j, uint64_t timeout_usec); | int sd_journal_wait(sd_journal *j, uint64_t timeout_usec); | |||
int sd_journal_reliable_fd(sd_journal *j); | int sd_journal_reliable_fd(sd_journal *j); | |||
int sd_journal_get_catalog(sd_journal *j, char **text); | int sd_journal_get_catalog(sd_journal *j, char **text); | |||
int sd_journal_get_catalog_for_message_id(sd_id128_t id, char **ret); | int sd_journal_get_catalog_for_message_id(sd_id128_t id, char **text); | |||
#define SD_JOURNAL_FOREACH(j) \ | #define SD_JOURNAL_FOREACH(j) \ | |||
if (sd_journal_seek_head(j) >= 0) \ | if (sd_journal_seek_head(j) >= 0) \ | |||
while (sd_journal_next(j) > 0) | while (sd_journal_next(j) > 0) | |||
#define SD_JOURNAL_FOREACH_BACKWARDS(j) \ | #define SD_JOURNAL_FOREACH_BACKWARDS(j) \ | |||
if (sd_journal_seek_tail(j) >= 0) \ | if (sd_journal_seek_tail(j) >= 0) \ | |||
while (sd_journal_previous(j) > 0) | while (sd_journal_previous(j) > 0) | |||
#define SD_JOURNAL_FOREACH_DATA(j, data, l) \ | #define SD_JOURNAL_FOREACH_DATA(j, data, l) \ | |||
for (sd_journal_restart_data(j); sd_journal_enumerate_data((j), &(d ata), &(l)) > 0; ) | for (sd_journal_restart_data(j); sd_journal_enumerate_data((j), &(d ata), &(l)) > 0; ) | |||
#define SD_JOURNAL_FOREACH_UNIQUE(j, data, l) \ | #define SD_JOURNAL_FOREACH_UNIQUE(j, data, l) \ | |||
for (sd_journal_restart_unique(j); sd_journal_enumerate_unique((j), &(data), &(l)) > 0; ) | for (sd_journal_restart_unique(j); sd_journal_enumerate_unique((j), &(data), &(l)) > 0; ) | |||
#ifdef __cplusplus | _SD_END_DECLARATIONS; | |||
} | ||||
#endif | ||||
#endif | #endif | |||
End of changes. 11 change blocks. | ||||
55 lines changed or deleted | 38 lines changed or added | |||
sd-login.h | sd-login.h | |||
---|---|---|---|---|
skipping to change at line 28 | skipping to change at line 28 | |||
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/>. | |||
***/ | ***/ | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#ifdef __cplusplus | #include "_sd-common.h" | |||
extern "C" { | ||||
#endif | ||||
/* | /* | |||
* A few points: | * A few points: | |||
* | * | |||
* Instead of returning an empty string array or empty uid array, we | * Instead of returning an empty string array or empty uid array, we | |||
* may return NULL. | * may return NULL. | |||
* | * | |||
* Free the data the library returns with libc free(). String arrays | * Free the data the library returns with libc free(). String arrays | |||
* are NULL terminated and you need to free the array itself in | * are NULL terminated, and you need to free the array itself, in | |||
* addition to the strings contained. | * addition to the strings contained. | |||
* | * | |||
* We return error codes as negative errno, kernel-style. 0 or | * We return error codes as negative errno, kernel-style. On success, we | |||
* positive on success. | * return 0 or positive. | |||
* | * | |||
* These functions access data in /proc, /sys/fs/cgroup and /run. All | * These functions access data in /proc, /sys/fs/cgroup, and /run. All | |||
* of these are virtual file systems, hence the accesses are | * of these are virtual file systems; therefore, accesses are | |||
* relatively cheap. | * relatively cheap. | |||
* | * | |||
* See sd-login(3) for more information. | * See sd-login(3) for more information. | |||
*/ | */ | |||
_SD_BEGIN_DECLARATIONS; | ||||
/* Get session from PID. Note that 'shared' processes of a user are | /* Get session from PID. Note that 'shared' processes of a user are | |||
* not attached to a session, but only attached to a user. This will | * not attached to a session, but only attached to a user. This will | |||
* return an error for system processes and 'shared' processes of a | * return an error for system processes and 'shared' processes of a | |||
* user. */ | * user. */ | |||
int sd_pid_get_session(pid_t pid, char **session); | int sd_pid_get_session(pid_t pid, char **session); | |||
/* Get UID of the owner of the session of the PID (or in case the | /* Get UID of the owner of the session of the PID (or in case the | |||
* process is a 'shared' user process the UID of that user is | * process is a 'shared' user process, the UID of that user is | |||
* returned). This will not return the UID of the process, but rather | * returned). This will not return the UID of the process, but rather | |||
* the UID of the owner of the cgroup the process is in. This will | * the UID of the owner of the cgroup that the process is in. This will | |||
* return an error for system processes. */ | * return an error for system processes. */ | |||
int sd_pid_get_owner_uid(pid_t pid, uid_t *uid); | int sd_pid_get_owner_uid(pid_t pid, uid_t *uid); | |||
/* Get systemd unit (i.e. service) name from PID, for system | /* Get systemd unit (i.e. service) name from PID, for system | |||
* services. This will return an error for non-service processes. */ | * services. This will return an error for non-service processes. */ | |||
int sd_pid_get_unit(pid_t pid, char **unit); | int sd_pid_get_unit(pid_t pid, char **unit); | |||
/* Get systemd unit (i.e. service) name from PID, for user | /* Get systemd unit (i.e. service) name from PID, for user | |||
* services. This will return an error for non-user-service | * services. This will return an error for non-user-service | |||
* processes. */ | * processes. */ | |||
int sd_pid_get_user_unit(pid_t pid, char **unit); | int sd_pid_get_user_unit(pid_t pid, char **unit); | |||
/* Get machine name from PID, for processes assigned to VM or | /* Get machine name from PID, for processes assigned to a VM or | |||
* container. This will return an error for non-machine processes. */ | * container. This will return an error for non-machine processes. */ | |||
int sd_pid_get_machine_name(pid_t pid, char **name); | int sd_pid_get_machine_name(pid_t pid, char **machine); | |||
/* Get slice name from PID. */ | /* Get slice name from PID. */ | |||
int sd_pid_get_slice(pid_t pid, char **name); | int sd_pid_get_slice(pid_t pid, char **slice); | |||
/* Similar to sd_pid_get_session(), but retrieves data about peer of | ||||
* connected AF_UNIX socket */ | ||||
int sd_peer_get_session(int fd, char **session); | ||||
/* Similar to sd_pid_get_owner_uid(), but retrieves data about peer of | ||||
* connected AF_UNIX socket */ | ||||
int sd_peer_get_owner_uid(int fd, uid_t *uid); | ||||
/* Similar to sd_pid_get_unit(), but retrieves data about peer of | ||||
* connected AF_UNIX socket */ | ||||
int sd_peer_get_unit(int fd, char **unit); | ||||
/* Similar to sd_pid_get_user_unit(), but retrieves data about peer of | ||||
* connected AF_UNIX socket */ | ||||
int sd_peer_get_user_unit(int fd, char **unit); | ||||
/* Similar to sd_pid_get_machine_name(), but retrieves data about peer | ||||
* of connected AF_UNIX socket */ | ||||
int sd_peer_get_machine_name(int fd, char **machine); | ||||
/* Get state from uid. Possible states: offline, lingering, online, active, | /* Similar to sd_pid_get_slice(), but retrieves data about peer of | |||
closing */ | * connected AF_UNIX socket */ | |||
int sd_uid_get_state(uid_t uid, char**state); | int sd_peer_get_slice(int fd, char **slice); | |||
/* Return 1 if uid has session on seat. If require_active is true will | /* Get state from UID. Possible states: offline, lingering, online, active, | |||
closing */ | ||||
int sd_uid_get_state(uid_t uid, char **state); | ||||
/* Return primary session of user, if there is any */ | ||||
int sd_uid_get_display(uid_t uid, char **session); | ||||
/* Return 1 if UID has session on seat. If require_active is true, this wil | ||||
l | ||||
* look for active sessions only. */ | * look for active sessions only. */ | |||
int sd_uid_is_on_seat(uid_t uid, int require_active, const char *seat); | int sd_uid_is_on_seat(uid_t uid, int require_active, const char *seat); | |||
/* Return sessions of user. If require_active is true will look for | /* Return sessions of user. If require_active is true, this will look for | |||
* active sessions only. Returns number of sessions as return | * active sessions only. Returns the number of sessions. | |||
* value. If sessions is NULL will just return number of sessions. */ | * If sessions is NULL, this will just return the number of sessions. */ | |||
int sd_uid_get_sessions(uid_t uid, int require_active, char ***sessions); | int sd_uid_get_sessions(uid_t uid, int require_active, char ***sessions); | |||
/* Return seats of user is on. If require_active is true will look for | /* Return seats of user is on. If require_active is true, this will look fo | |||
* active seats only. Returns number of seats. If seats is NULL will | r | |||
* just return number of seats.*/ | * active seats only. Returns the number of seats. | |||
* If seats is NULL, this will just return the number of seats.*/ | ||||
int sd_uid_get_seats(uid_t uid, int require_active, char ***seats); | int sd_uid_get_seats(uid_t uid, int require_active, char ***seats); | |||
/* Return 1 if the session is a active. */ | /* Return 1 if the session is active. */ | |||
int sd_session_is_active(const char *session); | int sd_session_is_active(const char *session); | |||
/* Get state from session. Possible states: online, active, closing | /* Return 1 if the session is remote. */ | |||
* (This function is a more generic version of | int sd_session_is_remote(const char *session); | |||
* sd_session_is_active().) */ | ||||
int sd_session_get_state(const char *sessio, char **state); | ||||
/* Determine user id of session */ | /* Get state from session. Possible states: online, active, closing. | |||
* This function is a more generic version of sd_session_is_active(). */ | ||||
int sd_session_get_state(const char *session, char **state); | ||||
/* Determine user ID of session */ | ||||
int sd_session_get_uid(const char *session, uid_t *uid); | int sd_session_get_uid(const char *session, uid_t *uid); | |||
/* Determine seat of session */ | /* Determine seat of session */ | |||
int sd_session_get_seat(const char *session, char **seat); | int sd_session_get_seat(const char *session, char **seat); | |||
/* Determine the (PAM) service name this session was registered by. */ | /* Determine the (PAM) service name this session was registered by. */ | |||
int sd_session_get_service(const char *session, char **service); | int sd_session_get_service(const char *session, char **service); | |||
/* Determine the type of this session, i.e. one of "tty", "x11" or "unspeci fied". */ | /* Determine the type of this session, i.e. one of "tty", "x11", "wayland", "mir" or "unspecified". */ | |||
int sd_session_get_type(const char *session, char **type); | int sd_session_get_type(const char *session, char **type); | |||
/* Determine the class of this session, i.e. one of "user", "greeter" or "l ock-screen". */ | /* Determine the class of this session, i.e. one of "user", "greeter" or "l ock-screen". */ | |||
int sd_session_get_class(const char *session, char **clazz); | int sd_session_get_class(const char *session, char **clazz); | |||
/* Determine the X11 display of this session. */ | /* Determine the X11 display of this session. */ | |||
int sd_session_get_display(const char *session, char **display); | int sd_session_get_display(const char *session, char **display); | |||
/* Determine the remote host of this session. */ | ||||
int sd_session_get_remote_host(const char *session, char **remote_host); | ||||
/* Determine the remote user of this session (if provided by PAM). */ | ||||
int sd_session_get_remote_user(const char *session, char **remote_user); | ||||
/* Determine the TTY of this session. */ | /* Determine the TTY of this session. */ | |||
int sd_session_get_tty(const char *session, char **display); | int sd_session_get_tty(const char *session, char **display); | |||
/* Determine the VT number of this session. */ | /* Determine the VT number of this session. */ | |||
int sd_session_get_vt(const char *session, unsigned *vtnr); | int sd_session_get_vt(const char *session, unsigned *vtnr); | |||
/* Return active session and user of seat */ | /* Return active session and user of seat */ | |||
int sd_seat_get_active(const char *seat, char **session, uid_t *uid); | int sd_seat_get_active(const char *seat, char **session, uid_t *uid); | |||
/* Return sessions and users on seat. Returns number of sessions as | /* Return sessions and users on seat. Returns number of sessions. | |||
* return value. If sessions is NULL returns only the number of | * If sessions is NULL, this returns only the number of sessions. */ | |||
* sessions. */ | ||||
int sd_seat_get_sessions(const char *seat, char ***sessions, uid_t **uid, u nsigned *n_uids); | int sd_seat_get_sessions(const char *seat, char ***sessions, uid_t **uid, u nsigned *n_uids); | |||
/* Return whether the seat is multi-session capable */ | /* Return whether the seat is multi-session capable */ | |||
int sd_seat_can_multi_session(const char *seat); | int sd_seat_can_multi_session(const char *seat); | |||
/* Return whether the seat is TTY capable, i.e. suitable for showing consol e UIs */ | /* Return whether the seat is TTY capable, i.e. suitable for showing consol e UIs */ | |||
int sd_seat_can_tty(const char *seat); | int sd_seat_can_tty(const char *seat); | |||
/* Return whether the seat is graphics capable, i.e. suitable for showing g raphical UIs */ | /* Return whether the seat is graphics capable, i.e. suitable for showing g raphical UIs */ | |||
int sd_seat_can_graphical(const char *seat); | int sd_seat_can_graphical(const char *seat); | |||
/* Return the class of machine */ | ||||
int sd_machine_get_class(const char *machine, char **clazz); | ||||
/* Get all seats, store in *seats. Returns the number of seats. If | /* Get all seats, store in *seats. Returns the number of seats. If | |||
* seats is NULL only returns number of seats. */ | * seats is NULL, this only returns the number of seats. */ | |||
int sd_get_seats(char ***seats); | int sd_get_seats(char ***seats); | |||
/* Get all sessions, store in *sessions. Returns the number of | /* Get all sessions, store in *sessions. Returns the number of | |||
* sessions. If sessions is NULL only returns number of sessions. */ | * sessions. If sessions is NULL, this only returns the number of sessions. */ | |||
int sd_get_sessions(char ***sessions); | int sd_get_sessions(char ***sessions); | |||
/* Get all logged in users, store in *users. Returns the number of | /* Get all logged in users, store in *users. Returns the number of | |||
* users. If users is NULL only returns the number of users. */ | * users. If users is NULL, this only returns the number of users. */ | |||
int sd_get_uids(uid_t **users); | int sd_get_uids(uid_t **users); | |||
/* Get all running virtual machines/containers */ | /* Get all running virtual machines/containers */ | |||
int sd_get_machine_names(char ***machines); | int sd_get_machine_names(char ***machines); | |||
/* Monitor object */ | /* Monitor object */ | |||
typedef struct sd_login_monitor sd_login_monitor; | typedef struct sd_login_monitor sd_login_monitor; | |||
/* Create a new monitor. Category must be NULL, "seat", "session", | /* Create a new monitor. Category must be NULL, "seat", "session", | |||
* "uid", "machine" to get monitor events for the specific category | * "uid", or "machine" to get monitor events for the specific category | |||
* (or all). */ | * (or all). */ | |||
int sd_login_monitor_new(const char *category, sd_login_monitor** ret); | int sd_login_monitor_new(const char *category, sd_login_monitor** ret); | |||
/* Destroys the passed monitor. Returns NULL. */ | /* Destroys the passed monitor. Returns NULL. */ | |||
sd_login_monitor* sd_login_monitor_unref(sd_login_monitor *m); | sd_login_monitor* sd_login_monitor_unref(sd_login_monitor *m); | |||
/* Flushes the monitor */ | /* Flushes the monitor */ | |||
int sd_login_monitor_flush(sd_login_monitor *m); | int sd_login_monitor_flush(sd_login_monitor *m); | |||
/* Get FD from monitor */ | /* Get FD from monitor */ | |||
int sd_login_monitor_get_fd(sd_login_monitor *m); | int sd_login_monitor_get_fd(sd_login_monitor *m); | |||
/* Get poll() mask to monitor */ | /* Get poll() mask to monitor */ | |||
int sd_login_monitor_get_events(sd_login_monitor *m); | int sd_login_monitor_get_events(sd_login_monitor *m); | |||
/* Get timeout for poll(), as usec value relative to CLOCK_MONOTONIC's epoc h */ | /* Get timeout for poll(), as usec value relative to CLOCK_MONOTONIC's epoc h */ | |||
int sd_login_monitor_get_timeout(sd_login_monitor *m, uint64_t *timeout_use c); | int sd_login_monitor_get_timeout(sd_login_monitor *m, uint64_t *timeout_use c); | |||
#ifdef __cplusplus | _SD_END_DECLARATIONS; | |||
} | ||||
#endif | ||||
#endif | #endif | |||
End of changes. 26 change blocks. | ||||
40 lines changed or deleted | 77 lines changed or added | |||
sd-memfd.h | sd-memfd.h | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
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/>. | |||
***/ | ***/ | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#ifdef __cplusplus | #include "_sd-common.h" | |||
extern "C" { | ||||
#endif | ||||
typedef struct sd_memfd sd_memfd; | _SD_BEGIN_DECLARATIONS; | |||
int sd_memfd_new(sd_memfd **m); | typedef struct sd_memfd sd_memfd; | |||
int sd_memfd_make(int fd, sd_memfd **m); | ||||
int sd_memfd_new_and_map(sd_memfd **m, size_t sz, void **p); | int sd_memfd_new(sd_memfd **m, const char *name); | |||
int sd_memfd_new_from_fd(sd_memfd **m, int fd); | ||||
int sd_memfd_new_and_map(sd_memfd **m, const char *name, size_t sz, void ** | ||||
p); | ||||
void sd_memfd_free(sd_memfd *m); | void sd_memfd_free(sd_memfd *m); | |||
int sd_memfd_get_fd(sd_memfd *m); | int sd_memfd_get_fd(sd_memfd *m); | |||
int sd_memfd_get_file(sd_memfd *m, FILE **f); | ||||
int sd_memfd_dup_fd(sd_memfd *n); | int sd_memfd_dup_fd(sd_memfd *n); | |||
int sd_memfd_get_file(sd_memfd *m, FILE **f); | ||||
int sd_memfd_map(sd_memfd *m, uint64_t offset, size_t size, void **p); | int sd_memfd_map(sd_memfd *m, uint64_t offset, size_t size, void **p); | |||
int sd_memfd_set_sealed(sd_memfd *m, int b); | int sd_memfd_set_sealed(sd_memfd *m, int b); | |||
int sd_memfd_get_sealed(sd_memfd *m); | int sd_memfd_get_sealed(sd_memfd *m); | |||
int sd_memfd_get_size(sd_memfd *m, uint64_t *sz); | int sd_memfd_get_size(sd_memfd *m, uint64_t *sz); | |||
int sd_memfd_set_size(sd_memfd *m, uint64_t sz); | int sd_memfd_set_size(sd_memfd *m, uint64_t sz); | |||
#ifdef __cplusplus | int sd_memfd_get_name(sd_memfd *m, char **name); | |||
} | ||||
#endif | _SD_END_DECLARATIONS; | |||
#endif | #endif | |||
End of changes. 7 change blocks. | ||||
11 lines changed or deleted | 11 lines changed or added | |||
sd-messages.h | sd-messages.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/>. | |||
***/ | ***/ | |||
#include <systemd/sd-id128.h> | #include "sd-id128.h" | |||
#include "_sd-common.h" | ||||
#ifdef __cplusplus | _SD_BEGIN_DECLARATIONS; | |||
extern "C" { | ||||
#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 | /* 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 | * with journalctl --new-id128. Do not use any other IDs, and do not | |||
* count them up manually. */ | * 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) | |||
skipping to change at line 79 | skipping to change at line 78 | |||
#define SD_MESSAGE_UNIT_RELOADED SD_ID128_MAKE(7b,05,eb,c6,68,38,42,22,b a,a8,88,11,79,cf,da,54) | #define SD_MESSAGE_UNIT_RELOADED SD_ID128_MAKE(7b,05,eb,c6,68,38,42,22,b a,a8,88,11,79,cf,da,54) | |||
#define SD_MESSAGE_SPAWN_FAILED SD_ID128_MAKE(64,12,57,65,1c,1b,4e,c9,a 8,62,4d,7a,40,a9,e1,e7) | #define SD_MESSAGE_SPAWN_FAILED SD_ID128_MAKE(64,12,57,65,1c,1b,4e,c9,a 8,62,4d,7a,40,a9,e1,e7) | |||
#define SD_MESSAGE_FORWARD_SYSLOG_MISSED SD_ID128_MAKE(00,27,22,9c,a0,64,41 ,81,a7,6c,4e,92,45,8a,fa,2e) | #define SD_MESSAGE_FORWARD_SYSLOG_MISSED SD_ID128_MAKE(00,27,22,9c,a0,64,41 ,81,a7,6c,4e,92,45,8a,fa,2e) | |||
#define SD_MESSAGE_OVERMOUNTING SD_ID128_MAKE(1d,ee,03,69,c7,fc,47,36,b 7,09,9b,38,ec,b4,6e,e7) | #define SD_MESSAGE_OVERMOUNTING SD_ID128_MAKE(1d,ee,03,69,c7,fc,47,36,b 7,09,9b,38,ec,b4,6e,e7) | |||
#define SD_MESSAGE_LID_OPENED SD_ID128_MAKE(b7,2e,a4,a2,88,15,45,a0,b 5,0e,20,0e,55,b9,b0,6f) | #define SD_MESSAGE_LID_OPENED SD_ID128_MAKE(b7,2e,a4,a2,88,15,45,a0,b 5,0e,20,0e,55,b9,b0,6f) | |||
#define SD_MESSAGE_LID_CLOSED SD_ID128_MAKE(b7,2e,a4,a2,88,15,45,a0,b 5,0e,20,0e,55,b9,b0,70) | #define SD_MESSAGE_LID_CLOSED SD_ID128_MAKE(b7,2e,a4,a2,88,15,45,a0,b 5,0e,20,0e,55,b9,b0,70) | |||
#define SD_MESSAGE_SYSTEM_DOCKED SD_ID128_MAKE(f5,f4,16,b8,62,07,4b,28,9 | ||||
2,7a,48,c3,ba,7d,51,ff) | ||||
#define SD_MESSAGE_SYSTEM_UNDOCKED SD_ID128_MAKE(51,e1,71,bd,58,52,48,56,8 | ||||
1,10,14,4c,51,7c,ca,53) | ||||
#define SD_MESSAGE_POWER_KEY SD_ID128_MAKE(b7,2e,a4,a2,88,15,45,a0,b 5,0e,20,0e,55,b9,b0,71) | #define SD_MESSAGE_POWER_KEY SD_ID128_MAKE(b7,2e,a4,a2,88,15,45,a0,b 5,0e,20,0e,55,b9,b0,71) | |||
#define SD_MESSAGE_SUSPEND_KEY SD_ID128_MAKE(b7,2e,a4,a2,88,15,45,a0,b 5,0e,20,0e,55,b9,b0,72) | #define SD_MESSAGE_SUSPEND_KEY SD_ID128_MAKE(b7,2e,a4,a2,88,15,45,a0,b 5,0e,20,0e,55,b9,b0,72) | |||
#define SD_MESSAGE_HIBERNATE_KEY SD_ID128_MAKE(b7,2e,a4,a2,88,15,45,a0,b 5,0e,20,0e,55,b9,b0,73) | #define SD_MESSAGE_HIBERNATE_KEY SD_ID128_MAKE(b7,2e,a4,a2,88,15,45,a0,b 5,0e,20,0e,55,b9,b0,73) | |||
#define SD_MESSAGE_CONFIG_ERROR SD_ID128_MAKE(c7,72,d2,4e,9a,88,4c,be,b 9,ea,12,62,5c,30,6c,01) | #define SD_MESSAGE_CONFIG_ERROR SD_ID128_MAKE(c7,72,d2,4e,9a,88,4c,be,b 9,ea,12,62,5c,30,6c,01) | |||
#define SD_MESSAGE_BOOTCHART SD_ID128_MAKE(9f,26,aa,56,2c,f4,40,c2,b 1,6c,77,3d,04,79,b5,18) | #define SD_MESSAGE_BOOTCHART SD_ID128_MAKE(9f,26,aa,56,2c,f4,40,c2,b 1,6c,77,3d,04,79,b5,18) | |||
#ifdef __cplusplus | _SD_END_DECLARATIONS; | |||
} | ||||
#endif | ||||
#endif | #endif | |||
End of changes. 4 change blocks. | ||||
7 lines changed or deleted | 8 lines changed or added | |||
sd-readahead.h | sd-readahead.h | |||
---|---|---|---|---|
skipping to change at line 35 | skipping to change at line 35 | |||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||
SOFTWARE. | SOFTWARE. | |||
***/ | ***/ | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
/* | /* | |||
Reference implementation of a few boot readahead related | Reference implementation of a few boot read-ahead-related | |||
interfaces. These interfaces are trivial to implement. To simplify | interfaces. These interfaces are trivial to implement. To simplify | |||
porting we provide this reference implementation. Applications are | porting, we provide this reference implementation. Applications are | |||
welcome to reimplement the algorithms described here if they do not | welcome to reimplement the algorithms described here if they do not | |||
want to include these two source files. | want to include these two source files. | |||
You may compile this with -DDISABLE_SYSTEMD to disable systemd | You may compile this with -DDISABLE_SYSTEMD to disable systemd | |||
support. This makes all calls NOPs. | support. This makes all calls NOPs. | |||
Since this is drop-in code we don't want any of our symbols to be | Because this is drop-in code, we don't want any of our symbols to be | |||
exported in any case. Hence we declare hidden visibility for all of | exported in any case. Hence, we declare hidden visibility for all of | |||
them. | them. | |||
You may find an up-to-date version of these source files online: | You may find an up-to-date version of these source files online: | |||
http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-readahea d.h | http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-readahea d.h | |||
http://cgit.freedesktop.org/systemd/systemd/plain/src/readahead/sd-readah ead.c | http://cgit.freedesktop.org/systemd/systemd/plain/src/readahead/sd-readah ead.c | |||
This should compile on non-Linux systems, too, but all functions | This should compile on non-Linux systems too, but all functions | |||
will become NOPs. | will become NOPs. | |||
See sd-readahead(3) for more information. | See sd-readahead(3) for more information. | |||
*/ | */ | |||
/* | /* | |||
Controls ongoing disk read-ahead operations during boot-up. The argument | Controls on-going disk read-ahead operations during boot-up. The argument | |||
must be a string, and either "cancel", "done" or "noreplay". | must be one of the following strings: "cancel", "done", or "noreplay". | |||
cancel = terminate read-ahead data collection, drop collected information | cancel = terminate read-ahead data collection, and drop collected informa | |||
done = terminate read-ahead data collection, keep collected information | tion | |||
done = terminate read-ahead data collection, and keep collected informati | ||||
on | ||||
noreplay = terminate read-ahead replay | noreplay = terminate read-ahead replay | |||
*/ | */ | |||
int sd_readahead(const char *action); | int sd_readahead(const char *action); | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
#endif | #endif | |||
End of changes. 6 change blocks. | ||||
9 lines changed or deleted | 11 lines changed or added | |||
sd-shutdown.h | sd-shutdown.h | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
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/>. | |||
***/ | ***/ | |||
/* Interface for scheduling and cancelling timed shutdowns. */ | /* Interface for scheduling and cancelling timed shutdowns. */ | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#ifdef __cplusplus | ||||
extern "C" { | ||||
#endif | ||||
#ifndef _sd_packed_ | ||||
# define _sd_packed_ __attribute__((packed)) | ||||
#endif | ||||
typedef enum sd_shutdown_mode { | typedef enum sd_shutdown_mode { | |||
SD_SHUTDOWN_NONE = 0, | SD_SHUTDOWN_NONE = 0, | |||
SD_SHUTDOWN_REBOOT = 'r', | SD_SHUTDOWN_REBOOT = 'r', | |||
SD_SHUTDOWN_POWEROFF = 'P', | SD_SHUTDOWN_POWEROFF = 'P', | |||
SD_SHUTDOWN_HALT = 'H', | SD_SHUTDOWN_HALT = 'H', | |||
SD_SHUTDOWN_KEXEC = 'K' | SD_SHUTDOWN_KEXEC = 'K' | |||
} sd_shutdown_mode_t; | } sd_shutdown_mode_t; | |||
/* Calculate the size of the message as "offsetof(struct | /* Calculate the size of the message as "offsetof(struct | |||
* sd_shutdown_command, wall_message) + | * sd_shutdown_command, wall_message) + | |||
skipping to change at line 58 | skipping to change at line 66 | |||
/* If non-zero, don't actually shut down, just pretend */ | /* If non-zero, don't actually shut down, just pretend */ | |||
unsigned dry_run:1; | unsigned dry_run:1; | |||
/* If non-zero, send our wall message */ | /* If non-zero, send our wall message */ | |||
unsigned warn_wall:1; | unsigned warn_wall:1; | |||
/* The wall message to send around. Leave empty for the | /* The wall message to send around. Leave empty for the | |||
* default wall message */ | * default wall message */ | |||
char wall_message[]; | char wall_message[]; | |||
} __attribute__((packed)); | } _sd_packed_; | |||
/* The scheme is very simple: | /* The scheme is very simple: | |||
* | * | |||
* To schedule a shutdown, simply fill in and send a single | * To schedule a shutdown, simply fill in and send a single | |||
* AF_UNIX/SOCK_DGRAM datagram with the structure above suffixed with | * AF_UNIX/SOCK_DGRAM datagram with the structure above suffixed with | |||
* the wall message to the socket /run/systemd/shutdownd (leave an | * the wall message to the socket /run/systemd/shutdownd (leave an | |||
* empty wall message for the default shutdown message). To calculate | * empty wall message for the default shutdown message). To calculate | |||
* the size of the message use "offsetof(struct sd_shutdown_command, | * the size of the message, use "offsetof(struct sd_shutdown_command, | |||
* wall_message) + strlen(command.wall_message)". | * wall_message) + strlen(command.wall_message)". | |||
* | * | |||
* To cancel a shutdown, do the same, but send an fully zeroed out | * To cancel a shutdown, do the same, but send a fully zeroed-out | |||
* structure. | * structure. | |||
* | * | |||
* To be notified about scheduled shutdowns, create an inotify watch | * To be notified about scheduled shutdowns, create an inotify watch | |||
* on /run/shutdown/. Whenever a file called "scheduled" appears a | * on /run/shutdown/. Whenever a file called "scheduled" appears, a | |||
* shutdown is scheduled. If it is removed it is canceled. It is | * shutdown is scheduled. If it is removed, it is canceled. If it is | |||
* replaced the scheduled shutdown has been changed. The file contains | * replaced, the scheduled shutdown has been changed. The file contains | |||
* a simple environment-like block, that contains information about | * a simple, environment-like block that contains information about | |||
* the scheduled shutdown: | * the scheduled shutdown: | |||
* | * | |||
* USEC= | * USEC= | |||
* encodes the time for the shutdown in usecs since the epoch UTC, | * encodes the time for the shutdown in usecs since the epoch UTC, | |||
* formatted as numeric string. | * formatted as a numeric string. | |||
* | * | |||
* WARN_WALL= | * WARN_WALL= | |||
* is 1 if a wall message shall be sent | * is 1 if a wall message shall be sent | |||
* | * | |||
* DRY_RUN= | * DRY_RUN= | |||
* is 1 if a dry run shutdown is scheduled | * is 1 if a dry-run shutdown is scheduled | |||
* | * | |||
* MODE= | * MODE= | |||
* is the shutdown mode, one of "poweroff", "reboot", "halt", "kexec" | * is the shutdown mode, one of "poweroff", "reboot", "halt", "kexec" | |||
* | * | |||
* WALL_MESSAGE= | * WALL_MESSAGE= | |||
* is the wall message to use, with all special characters escape in C styl e. | * is the wall message to use, with all special characters escaped in C-sty le. | |||
* | * | |||
* Note that some fields might be missing if they do not apply. | * Note that some fields might be missing if they do not apply. | |||
* | * | |||
* Note that the file is first written to a temporary file and then | * Note that the file is first written to a temporary file and then | |||
* renamed, in order to provide atomic properties for readers: if the | * renamed, in order to provide atomic properties for readers: if the | |||
* file exists under the name "scheduled" it is guaranteed to be fully | * file exists under the name "scheduled", it is guaranteed to be fully | |||
* written. A reader should ignore all files in that directory by any | * written. A reader should ignore all files in that directory by any | |||
* other name. | * other name. | |||
* | * | |||
* Scheduled shutdowns are only accepted from privileged processes, | * Scheduled shutdowns are only accepted from privileged processes, | |||
* but the directory may be watched and the file in it read by | * but anyone may watch the directory and the file in it. | |||
* anybody. | ||||
*/ | */ | |||
#ifdef __cplusplus | ||||
} | ||||
#endif | ||||
#endif | #endif | |||
End of changes. 11 change blocks. | ||||
13 lines changed or deleted | 24 lines changed or added | |||
securebits.h | securebits.h | |||
---|---|---|---|---|
skipping to change at line 41 | skipping to change at line 41 | |||
#define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable * / | #define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable * / | |||
/* Each securesetting is implemented using two bits. One bit specifies | /* Each securesetting is implemented using two bits. One bit specifies | |||
whether the setting is on or off. The other bit specify whether the | whether the setting is on or off. The other bit specify whether the | |||
setting is locked or not. A setting which is locked cannot be | setting is locked or not. A setting which is locked cannot be | |||
changed from user-level. */ | changed from user-level. */ | |||
#define issecure_mask(X) (1 << (X)) | #define issecure_mask(X) (1 << (X)) | |||
#define issecure(X) (issecure_mask(X) & current_cred_xxx(secureb its)) | #define issecure(X) (issecure_mask(X) & current_cred_xxx(secureb its)) | |||
#define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \ | #define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \ | |||
issecure_mask(SECURE_NO_SETUID_FIXUP) | \ | issecure_mask(SECURE_NO_SETUID_FIXUP) | \ | |||
issecure_mask(SECURE_KEEP_CAPS)) | issecure_mask(SECURE_KEEP_CAPS)) | |||
#define SECURE_ALL_LOCKS (SECURE_ALL_BITS << 1) | #define SECURE_ALL_LOCKS (SECURE_ALL_BITS << 1) | |||
#endif /* !_LINUX_SECUREBITS_H */ | #endif /* !_LINUX_SECUREBITS_H */ | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
selinux-access.h | selinux-access.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
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/>. | |||
***/ | ***/ | |||
#include <dbus.h> | #include "sd-bus.h" | |||
#include "bus-error.h" | ||||
#include "bus-util.h" | ||||
void selinux_access_free(void); | void selinux_access_free(void); | |||
int selinux_access_check(DBusConnection *connection, DBusMessage *message, const char *path, const char *permission, DBusError *error); | int selinux_generic_access_check(sd_bus_message *message, const char *path, const char *permission, sd_bus_error *error); | |||
#ifdef HAVE_SELINUX | #ifdef HAVE_SELINUX | |||
#define SELINUX_ACCESS_CHECK(connection, message, permission) \ | #define selinux_access_check(message, permission, error) \ | |||
do { \ | selinux_generic_access_check((message), NULL, (permission), (error) | |||
DBusError _error; \ | ) | |||
int _r; \ | ||||
DBusConnection *_c = (connection); \ | #define selinux_unit_access_check(unit, message, permission, error) \ | |||
DBusMessage *_m = (message); \ | ({ \ | |||
dbus_error_init(&_error); \ | Unit *_unit = (unit); \ | |||
_r = selinux_access_check(_c, _m, NULL, (permission), &_err | selinux_generic_access_check((message), _unit->fragment_pat | |||
or); \ | h ?: _unit->fragment_path, (permission), (error)); \ | |||
if (_r < 0) \ | }) | |||
return bus_send_error_reply(_c, _m, &_error, _r); \ | ||||
} while (false) | ||||
#define SELINUX_UNIT_ACCESS_CHECK(unit, connection, message, permission) \ | ||||
do { \ | ||||
DBusError _error; \ | ||||
int _r; \ | ||||
DBusConnection *_c = (connection); \ | ||||
DBusMessage *_m = (message); \ | ||||
Unit *_u = (unit); \ | ||||
dbus_error_init(&_error); \ | ||||
_r = selinux_access_check(_c, _m, _u->source_path ?: _u->fr | ||||
agment_path, (permission), &_error); \ | ||||
if (_r < 0) \ | ||||
return bus_send_error_reply(_c, _m, &_error, _r); \ | ||||
} while (false) | ||||
#else | #else | |||
#define SELINUX_ACCESS_CHECK(connection, message, permission) do { } while | #define selinux_access_check(message, permission, error) 0 | |||
(false) | #define selinux_unit_access_check(unit, message, permission, error) 0 | |||
#define SELINUX_UNIT_ACCESS_CHECK(unit, connection, message, permission) do | ||||
{ } while (false) | ||||
#endif | #endif | |||
End of changes. 4 change blocks. | ||||
32 lines changed or deleted | 16 lines changed or added | |||
service.h | service.h | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
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 Service Service; | typedef struct Service Service; | |||
#include "unit.h" | #include "unit.h" | |||
#include "path.h" | #include "path.h" | |||
#include "ratelimit.h" | #include "ratelimit.h" | |||
#include "service.h" | ||||
#include "kill.h" | #include "kill.h" | |||
#include "exit-status.h" | #include "exit-status.h" | |||
typedef enum ServiceState { | typedef enum ServiceState { | |||
SERVICE_DEAD, | SERVICE_DEAD, | |||
SERVICE_START_PRE, | SERVICE_START_PRE, | |||
SERVICE_START, | SERVICE_START, | |||
SERVICE_START_POST, | SERVICE_START_POST, | |||
SERVICE_RUNNING, | SERVICE_RUNNING, | |||
SERVICE_EXITED, /* Nothing is running anymore, but Remai nAfterExit is true hence this is OK */ | SERVICE_EXITED, /* Nothing is running anymore, but Remai nAfterExit is true hence this is OK */ | |||
skipping to change at line 57 | skipping to change at line 56 | |||
SERVICE_FAILED, | SERVICE_FAILED, | |||
SERVICE_AUTO_RESTART, | SERVICE_AUTO_RESTART, | |||
_SERVICE_STATE_MAX, | _SERVICE_STATE_MAX, | |||
_SERVICE_STATE_INVALID = -1 | _SERVICE_STATE_INVALID = -1 | |||
} ServiceState; | } ServiceState; | |||
typedef enum ServiceRestart { | typedef enum ServiceRestart { | |||
SERVICE_RESTART_NO, | SERVICE_RESTART_NO, | |||
SERVICE_RESTART_ON_SUCCESS, | SERVICE_RESTART_ON_SUCCESS, | |||
SERVICE_RESTART_ON_FAILURE, | SERVICE_RESTART_ON_FAILURE, | |||
SERVICE_RESTART_ON_ABNORMAL, | ||||
SERVICE_RESTART_ON_WATCHDOG, | SERVICE_RESTART_ON_WATCHDOG, | |||
SERVICE_RESTART_ON_ABORT, | SERVICE_RESTART_ON_ABORT, | |||
SERVICE_RESTART_ALWAYS, | SERVICE_RESTART_ALWAYS, | |||
_SERVICE_RESTART_MAX, | _SERVICE_RESTART_MAX, | |||
_SERVICE_RESTART_INVALID = -1 | _SERVICE_RESTART_INVALID = -1 | |||
} ServiceRestart; | } ServiceRestart; | |||
typedef enum ServiceType { | typedef enum ServiceType { | |||
SERVICE_SIMPLE, /* we fork and go on right-away (i.e. modern sock et activated daemons) */ | SERVICE_SIMPLE, /* we fork and go on right-away (i.e. modern sock et activated daemons) */ | |||
SERVICE_FORKING, /* forks by itself (i.e. traditional daemons) */ | SERVICE_FORKING, /* forks by itself (i.e. traditional daemons) */ | |||
skipping to change at line 107 | skipping to change at line 107 | |||
SERVICE_FAILURE_TIMEOUT, | SERVICE_FAILURE_TIMEOUT, | |||
SERVICE_FAILURE_EXIT_CODE, | SERVICE_FAILURE_EXIT_CODE, | |||
SERVICE_FAILURE_SIGNAL, | SERVICE_FAILURE_SIGNAL, | |||
SERVICE_FAILURE_CORE_DUMP, | SERVICE_FAILURE_CORE_DUMP, | |||
SERVICE_FAILURE_WATCHDOG, | SERVICE_FAILURE_WATCHDOG, | |||
SERVICE_FAILURE_START_LIMIT, | SERVICE_FAILURE_START_LIMIT, | |||
_SERVICE_RESULT_MAX, | _SERVICE_RESULT_MAX, | |||
_SERVICE_RESULT_INVALID = -1 | _SERVICE_RESULT_INVALID = -1 | |||
} ServiceResult; | } ServiceResult; | |||
typedef enum StartLimitAction { | typedef enum FailureAction { | |||
SERVICE_START_LIMIT_NONE, | SERVICE_FAILURE_ACTION_NONE, | |||
SERVICE_START_LIMIT_REBOOT, | SERVICE_FAILURE_ACTION_REBOOT, | |||
SERVICE_START_LIMIT_REBOOT_FORCE, | SERVICE_FAILURE_ACTION_REBOOT_FORCE, | |||
SERVICE_START_LIMIT_REBOOT_IMMEDIATE, | SERVICE_FAILURE_ACTION_REBOOT_IMMEDIATE, | |||
_SERVICE_START_LIMIT_MAX, | _SERVICE_FAILURE_ACTION_MAX, | |||
_SERVICE_START_LIMIT_INVALID = -1 | _SERVICE_FAILURE_ACTION_INVALID = -1 | |||
} StartLimitAction; | } FailureAction; | |||
struct Service { | struct Service { | |||
Unit meta; | Unit meta; | |||
ServiceType type; | ServiceType type; | |||
ServiceRestart restart; | ServiceRestart restart; | |||
ExitStatusSet restart_ignore_status; | ExitStatusSet restart_prevent_status; | |||
ExitStatusSet restart_force_status; | ||||
ExitStatusSet success_status; | ExitStatusSet success_status; | |||
/* If set we'll read the main daemon PID from this file */ | /* If set we'll read the main daemon PID from this file */ | |||
char *pid_file; | char *pid_file; | |||
usec_t restart_usec; | usec_t restart_usec; | |||
usec_t timeout_start_usec; | usec_t timeout_start_usec; | |||
usec_t timeout_stop_usec; | usec_t timeout_stop_usec; | |||
dual_timestamp watchdog_timestamp; | dual_timestamp watchdog_timestamp; | |||
usec_t watchdog_usec; | usec_t watchdog_usec; | |||
Watch watchdog_watch; | sd_event_source *watchdog_event_source; | |||
ExecCommand* exec_command[_SERVICE_EXEC_COMMAND_MAX]; | ExecCommand* exec_command[_SERVICE_EXEC_COMMAND_MAX]; | |||
ExecContext exec_context; | ExecContext exec_context; | |||
KillContext kill_context; | KillContext kill_context; | |||
CGroupContext cgroup_context; | CGroupContext cgroup_context; | |||
ServiceState state, deserialized_state; | ServiceState state, deserialized_state; | |||
/* The exit status of the real main process */ | /* The exit status of the real main process */ | |||
skipping to change at line 157 | skipping to change at line 158 | |||
ExecCommand *control_command; | ExecCommand *control_command; | |||
/* The currently executed main process, which may be NULL if | /* The currently executed main process, which may be NULL if | |||
* the main process got started via forking mode and not by | * the main process got started via forking mode and not by | |||
* us */ | * us */ | |||
ExecCommand *main_command; | ExecCommand *main_command; | |||
/* The ID of the control command currently being executed */ | /* The ID of the control command currently being executed */ | |||
ServiceExecCommand control_command_id; | ServiceExecCommand control_command_id; | |||
/* Runtime data of the execution context */ | ||||
ExecRuntime *exec_runtime; | ||||
pid_t main_pid, control_pid; | pid_t main_pid, control_pid; | |||
int socket_fd; | int socket_fd; | |||
int fsck_passno; | ||||
bool permissions_start_only; | bool permissions_start_only; | |||
bool root_directory_start_only; | bool root_directory_start_only; | |||
bool remain_after_exit; | bool remain_after_exit; | |||
bool guess_main_pid; | bool guess_main_pid; | |||
/* If we shut down, remember why */ | /* If we shut down, remember why */ | |||
ServiceResult result; | ServiceResult result; | |||
ServiceResult reload_result; | ServiceResult reload_result; | |||
bool main_pid_known:1; | bool main_pid_known:1; | |||
bool main_pid_alien:1; | bool main_pid_alien:1; | |||
bool bus_name_good:1; | bool bus_name_good:1; | |||
bool forbid_restart:1; | bool forbid_restart:1; | |||
bool got_socket_fd:1; | ||||
bool start_timeout_defined:1; | bool start_timeout_defined:1; | |||
#ifdef HAVE_SYSV_COMPAT | #ifdef HAVE_SYSV_COMPAT | |||
bool is_sysv:1; | ||||
bool sysv_has_lsb:1; | ||||
bool sysv_enabled:1; | ||||
int sysv_start_priority_from_rcnd; | ||||
int sysv_start_priority; | int sysv_start_priority; | |||
char *sysv_runlevels; | ||||
#endif | #endif | |||
char *bus_name; | char *bus_name; | |||
char *status_text; | char *status_text; | |||
FailureAction failure_action; | ||||
RateLimit start_limit; | RateLimit start_limit; | |||
StartLimitAction start_limit_action; | FailureAction start_limit_action; | |||
char *reboot_arg; | ||||
UnitRef accept_socket; | UnitRef accept_socket; | |||
Watch timer_watch; | sd_event_source *timer_event_source; | |||
PathSpec *pid_file_pathspec; | PathSpec *pid_file_pathspec; | |||
NotifyAccess notify_access; | NotifyAccess notify_access; | |||
}; | }; | |||
extern const UnitVTable service_vtable; | extern const UnitVTable service_vtable; | |||
struct Socket; | struct Socket; | |||
int service_set_socket_fd(Service *s, int fd, struct Socket *socket); | int service_set_socket_fd(Service *s, int fd, struct Socket *socket); | |||
skipping to change at line 226 | skipping to change at line 224 | |||
const char* service_exec_command_to_string(ServiceExecCommand i) _const_; | const char* service_exec_command_to_string(ServiceExecCommand i) _const_; | |||
ServiceExecCommand service_exec_command_from_string(const char *s) _pure_; | ServiceExecCommand service_exec_command_from_string(const char *s) _pure_; | |||
const char* notify_access_to_string(NotifyAccess i) _const_; | const char* notify_access_to_string(NotifyAccess i) _const_; | |||
NotifyAccess notify_access_from_string(const char *s) _pure_; | NotifyAccess notify_access_from_string(const char *s) _pure_; | |||
const char* service_result_to_string(ServiceResult i) _const_; | const char* service_result_to_string(ServiceResult i) _const_; | |||
ServiceResult service_result_from_string(const char *s) _pure_; | ServiceResult service_result_from_string(const char *s) _pure_; | |||
const char* start_limit_action_to_string(StartLimitAction i) _const_; | const char* failure_action_to_string(FailureAction i) _const_; | |||
StartLimitAction start_limit_action_from_string(const char *s) _pure_; | FailureAction failure_action_from_string(const char *s) _pure_; | |||
End of changes. 14 change blocks. | ||||
22 lines changed or deleted | 20 lines changed or added | |||
set.h | set.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/>. | |||
***/ | ***/ | |||
/* Pretty straightforward set implementation. Internally based on the | /* Pretty straightforward set implementation. Internally based on the | |||
* hashmap. That means that as a minor optimization a NULL set | * hashmap. That means that as a minor optimization a NULL set | |||
* object will be treated as empty set for all read | * object will be treated as empty set for all read | |||
* operations. That way it is not necessary to instantiate an object | * operations. That way it is not necessary to instantiate an object | |||
* for each set use. */ | * for each set use. */ | |||
#include "hashmap.h" | #include "hashmap.h" | |||
#include "util.h" | ||||
typedef struct Set Set; | typedef struct Set Set; | |||
Set *set_new(hash_func_t hash_func, compare_func_t compare_func); | Set *set_new(hash_func_t hash_func, compare_func_t compare_func); | |||
void set_free(Set* s); | void set_free(Set* s); | |||
static inline void set_freep(Set **s) { | ||||
set_free(*s); | ||||
} | ||||
void set_free_free(Set *s); | void set_free_free(Set *s); | |||
static inline void set_free_freep(Set **s) { | ||||
set_free_free(*s); | ||||
} | ||||
Set* set_copy(Set *s); | Set* set_copy(Set *s); | |||
int set_ensure_allocated(Set **s, hash_func_t hash_func, compare_func_t com pare_func); | int set_ensure_allocated(Set **s, hash_func_t hash_func, compare_func_t com pare_func); | |||
int set_put(Set *s, void *value); | int set_put(Set *s, void *value); | |||
int set_consume(Set *s, void *value); | int set_consume(Set *s, void *value); | |||
int set_replace(Set *s, void *value); | int set_replace(Set *s, void *value); | |||
void *set_get(Set *s, void *value); | void *set_get(Set *s, void *value); | |||
bool set_contains(Set *s, void *value); | bool set_contains(Set *s, void *value); | |||
void *set_remove(Set *s, void *value); | void *set_remove(Set *s, void *value); | |||
skipping to change at line 82 | skipping to change at line 76 | |||
void* set_last(Set *s); | void* set_last(Set *s); | |||
char **set_get_strv(Set *s); | char **set_get_strv(Set *s); | |||
#define SET_FOREACH(e, s, i) \ | #define SET_FOREACH(e, s, i) \ | |||
for ((i) = ITERATOR_FIRST, (e) = set_iterate((s), &(i)); (e); (e) = set_iterate((s), &(i))) | for ((i) = ITERATOR_FIRST, (e) = set_iterate((s), &(i)); (e); (e) = set_iterate((s), &(i))) | |||
#define SET_FOREACH_BACKWARDS(e, s, i) \ | #define SET_FOREACH_BACKWARDS(e, s, i) \ | |||
for ((i) = ITERATOR_LAST, (e) = set_iterate_backwards((s), &(i)); ( e); (e) = set_iterate_backwards((s), &(i))) | for ((i) = ITERATOR_LAST, (e) = set_iterate_backwards((s), &(i)); ( e); (e) = set_iterate_backwards((s), &(i))) | |||
DEFINE_TRIVIAL_CLEANUP_FUNC(Set*, set_free); | ||||
DEFINE_TRIVIAL_CLEANUP_FUNC(Set*, set_free_free); | ||||
#define _cleanup_set_free_ _cleanup_(set_freep) | #define _cleanup_set_free_ _cleanup_(set_freep) | |||
#define _cleanup_set_free_free_ _cleanup_(set_free_freep) | #define _cleanup_set_free_free_ _cleanup_(set_free_freep) | |||
End of changes. 4 change blocks. | ||||
7 lines changed or deleted | 3 lines changed or added | |||
smack-setup.h | smack-setup.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
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/>. | |||
***/ | ***/ | |||
int smack_setup(void); | int smack_setup(bool *loaded_policy); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
snapshot.h | snapshot.h | |||
---|---|---|---|---|
skipping to change at line 45 | skipping to change at line 45 | |||
struct Snapshot { | struct Snapshot { | |||
Unit meta; | Unit meta; | |||
SnapshotState state, deserialized_state; | SnapshotState state, deserialized_state; | |||
bool cleanup; | bool cleanup; | |||
}; | }; | |||
extern const UnitVTable snapshot_vtable; | extern const UnitVTable snapshot_vtable; | |||
int snapshot_create(Manager *m, const char *name, bool cleanup, DBusError * e, Snapshot **s); | int snapshot_create(Manager *m, const char *name, bool cleanup, sd_bus_erro r *e, Snapshot **s); | |||
void snapshot_remove(Snapshot *s); | void snapshot_remove(Snapshot *s); | |||
const char* snapshot_state_to_string(SnapshotState i) _const_; | const char* snapshot_state_to_string(SnapshotState i) _const_; | |||
SnapshotState snapshot_state_from_string(const char *s) _pure_; | SnapshotState snapshot_state_from_string(const char *s) _pure_; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
socket-util.h | socket-util.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
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/>. | |||
***/ | ***/ | |||
#include <sys/socket.h> | #include <sys/socket.h> | |||
#include <netinet/in.h> | #include <netinet/in.h> | |||
#include <sys/un.h> | #include <sys/un.h> | |||
#include <net/if.h> | ||||
#include <asm/types.h> | #include <asm/types.h> | |||
#include <linux/netlink.h> | #include <linux/netlink.h> | |||
#include <linux/if_packet.h> | ||||
#include "macro.h" | #include "macro.h" | |||
#include "util.h" | #include "util.h" | |||
union sockaddr_union { | union sockaddr_union { | |||
struct sockaddr sa; | struct sockaddr sa; | |||
struct sockaddr_in in4; | struct sockaddr_in in; | |||
struct sockaddr_in6 in6; | struct sockaddr_in6 in6; | |||
struct sockaddr_un un; | struct sockaddr_un un; | |||
struct sockaddr_nl nl; | struct sockaddr_nl nl; | |||
struct sockaddr_storage storage; | struct sockaddr_storage storage; | |||
struct sockaddr_ll ll; | ||||
}; | ||||
union in_addr_union { | ||||
struct in_addr in; | ||||
struct in6_addr in6; | ||||
}; | }; | |||
typedef struct SocketAddress { | typedef struct SocketAddress { | |||
union sockaddr_union sockaddr; | union sockaddr_union sockaddr; | |||
/* We store the size here explicitly due to the weird | /* We store the size here explicitly due to the weird | |||
* sockaddr_un semantics for abstract sockets */ | * sockaddr_un semantics for abstract sockets */ | |||
socklen_t size; | socklen_t size; | |||
/* Socket type, i.e. SOCK_STREAM, SOCK_DGRAM, ... */ | /* Socket type, i.e. SOCK_STREAM, SOCK_DGRAM, ... */ | |||
skipping to change at line 71 | skipping to change at line 77 | |||
_SOCKET_ADDRESS_BIND_IPV6_ONLY_MAX, | _SOCKET_ADDRESS_BIND_IPV6_ONLY_MAX, | |||
_SOCKET_ADDRESS_BIND_IPV6_ONLY_INVALID = -1 | _SOCKET_ADDRESS_BIND_IPV6_ONLY_INVALID = -1 | |||
} SocketAddressBindIPv6Only; | } SocketAddressBindIPv6Only; | |||
#define socket_address_family(a) ((a)->sockaddr.sa.sa_family) | #define socket_address_family(a) ((a)->sockaddr.sa.sa_family) | |||
int socket_address_parse(SocketAddress *a, const char *s); | int socket_address_parse(SocketAddress *a, const char *s); | |||
int socket_address_parse_netlink(SocketAddress *a, const char *s); | int socket_address_parse_netlink(SocketAddress *a, const char *s); | |||
int socket_address_print(const SocketAddress *a, char **p); | int socket_address_print(const SocketAddress *a, char **p); | |||
int socket_address_verify(const SocketAddress *a) _pure_; | int socket_address_verify(const SocketAddress *a) _pure_; | |||
int socket_address_unlink(SocketAddress *a); | ||||
bool socket_address_can_accept(const SocketAddress *a) _pure_; | bool socket_address_can_accept(const SocketAddress *a) _pure_; | |||
int socket_address_listen( | int socket_address_listen( | |||
const SocketAddress *a, | const SocketAddress *a, | |||
int flags, | ||||
int backlog, | int backlog, | |||
SocketAddressBindIPv6Only only, | SocketAddressBindIPv6Only only, | |||
const char *bind_to_device, | const char *bind_to_device, | |||
bool free_bind, | bool free_bind, | |||
bool transparent, | bool transparent, | |||
mode_t directory_mode, | mode_t directory_mode, | |||
mode_t socket_mode, | mode_t socket_mode, | |||
const char *label, | const char *label); | |||
int *ret); | int make_socket_fd(int log_level, const char* address, int flags); | |||
bool socket_address_is(const SocketAddress *a, const char *s, int type); | bool socket_address_is(const SocketAddress *a, const char *s, int type); | |||
bool socket_address_is_netlink(const SocketAddress *a, const char *s); | bool socket_address_is_netlink(const SocketAddress *a, const char *s); | |||
bool socket_address_matches_fd(const SocketAddress *a, int fd); | bool socket_address_matches_fd(const SocketAddress *a, int fd); | |||
int make_socket_fd(const char* address, int flags); | ||||
bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) _ pure_; | bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) _ pure_; | |||
const char* socket_address_get_path(const SocketAddress *a); | const char* socket_address_get_path(const SocketAddress *a); | |||
bool socket_ipv6_is_supported(void); | ||||
int sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool trans | ||||
late_ipv6, char **ret); | ||||
int getpeername_pretty(int fd, char **ret); | ||||
int getsockname_pretty(int fd, char **ret); | ||||
const char* socket_address_bind_ipv6_only_to_string(SocketAddressBindIPv6On ly b) _const_; | const char* socket_address_bind_ipv6_only_to_string(SocketAddressBindIPv6On ly b) _const_; | |||
SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const c har *s) _pure_; | SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const c har *s) _pure_; | |||
int netlink_family_to_string_alloc(int b, char **s); | int netlink_family_to_string_alloc(int b, char **s); | |||
int netlink_family_from_string(const char *s); | int netlink_family_from_string(const char *s) _pure_; | |||
bool socket_ipv6_is_supported(void); | int in_addr_null(unsigned family, union in_addr_union *u); | |||
int in_addr_equal(unsigned family, union in_addr_union *a, union in_addr_un | ||||
ion *b); | ||||
int in_addr_prefix_intersect(unsigned family, const union in_addr_union *a, | ||||
unsigned aprefixlen, const union in_addr_union *b, unsigned bprefixlen); | ||||
int in_addr_prefix_next(unsigned family, union in_addr_union *u, unsigned p | ||||
refixlen); | ||||
int in_addr_to_string(unsigned family, const union in_addr_union *u, char * | ||||
*ret); | ||||
int in_addr_from_string(unsigned family, const char *s, union in_addr_union | ||||
*ret); | ||||
End of changes. 11 change blocks. | ||||
7 lines changed or deleted | 20 lines changed or added | |||
socket.h | socket.h | |||
---|---|---|---|---|
skipping to change at line 35 | skipping to change at line 35 | |||
#include "manager.h" | #include "manager.h" | |||
#include "unit.h" | #include "unit.h" | |||
#include "socket-util.h" | #include "socket-util.h" | |||
#include "mount.h" | #include "mount.h" | |||
#include "service.h" | #include "service.h" | |||
typedef enum SocketState { | typedef enum SocketState { | |||
SOCKET_DEAD, | SOCKET_DEAD, | |||
SOCKET_START_PRE, | SOCKET_START_PRE, | |||
SOCKET_START_CHOWN, | ||||
SOCKET_START_POST, | SOCKET_START_POST, | |||
SOCKET_LISTENING, | SOCKET_LISTENING, | |||
SOCKET_RUNNING, | SOCKET_RUNNING, | |||
SOCKET_STOP_PRE, | SOCKET_STOP_PRE, | |||
SOCKET_STOP_PRE_SIGTERM, | SOCKET_STOP_PRE_SIGTERM, | |||
SOCKET_STOP_PRE_SIGKILL, | SOCKET_STOP_PRE_SIGKILL, | |||
SOCKET_STOP_POST, | SOCKET_STOP_POST, | |||
SOCKET_FINAL_SIGTERM, | SOCKET_FINAL_SIGTERM, | |||
SOCKET_FINAL_SIGKILL, | SOCKET_FINAL_SIGKILL, | |||
SOCKET_FAILED, | SOCKET_FAILED, | |||
_SOCKET_STATE_MAX, | _SOCKET_STATE_MAX, | |||
_SOCKET_STATE_INVALID = -1 | _SOCKET_STATE_INVALID = -1 | |||
} SocketState; | } SocketState; | |||
typedef enum SocketExecCommand { | typedef enum SocketExecCommand { | |||
SOCKET_EXEC_START_PRE, | SOCKET_EXEC_START_PRE, | |||
SOCKET_EXEC_START_CHOWN, | ||||
SOCKET_EXEC_START_POST, | SOCKET_EXEC_START_POST, | |||
SOCKET_EXEC_STOP_PRE, | SOCKET_EXEC_STOP_PRE, | |||
SOCKET_EXEC_STOP_POST, | SOCKET_EXEC_STOP_POST, | |||
_SOCKET_EXEC_COMMAND_MAX, | _SOCKET_EXEC_COMMAND_MAX, | |||
_SOCKET_EXEC_COMMAND_INVALID = -1 | _SOCKET_EXEC_COMMAND_INVALID = -1 | |||
} SocketExecCommand; | } SocketExecCommand; | |||
typedef enum SocketType { | typedef enum SocketType { | |||
SOCKET_SOCKET, | SOCKET_SOCKET, | |||
SOCKET_FIFO, | SOCKET_FIFO, | |||
skipping to change at line 80 | skipping to change at line 82 | |||
SOCKET_FAILURE_TIMEOUT, | SOCKET_FAILURE_TIMEOUT, | |||
SOCKET_FAILURE_EXIT_CODE, | SOCKET_FAILURE_EXIT_CODE, | |||
SOCKET_FAILURE_SIGNAL, | SOCKET_FAILURE_SIGNAL, | |||
SOCKET_FAILURE_CORE_DUMP, | SOCKET_FAILURE_CORE_DUMP, | |||
SOCKET_FAILURE_SERVICE_FAILED_PERMANENT, | SOCKET_FAILURE_SERVICE_FAILED_PERMANENT, | |||
_SOCKET_RESULT_MAX, | _SOCKET_RESULT_MAX, | |||
_SOCKET_RESULT_INVALID = -1 | _SOCKET_RESULT_INVALID = -1 | |||
} SocketResult; | } SocketResult; | |||
typedef struct SocketPort { | typedef struct SocketPort { | |||
Socket *socket; | ||||
SocketType type; | SocketType type; | |||
int fd; | int fd; | |||
SocketAddress address; | SocketAddress address; | |||
char *path; | char *path; | |||
Watch fd_watch; | sd_event_source *event_source; | |||
LIST_FIELDS(struct SocketPort, port); | LIST_FIELDS(struct SocketPort, port); | |||
} SocketPort; | } SocketPort; | |||
struct Socket { | struct Socket { | |||
Unit meta; | Unit meta; | |||
LIST_HEAD(SocketPort, ports); | LIST_HEAD(SocketPort, ports); | |||
unsigned n_accepted; | unsigned n_accepted; | |||
unsigned n_connections; | unsigned n_connections; | |||
unsigned max_connections; | unsigned max_connections; | |||
unsigned backlog; | unsigned backlog; | |||
usec_t timeout_usec; | usec_t timeout_usec; | |||
ExecCommand* exec_command[_SOCKET_EXEC_COMMAND_MAX]; | ExecCommand* exec_command[_SOCKET_EXEC_COMMAND_MAX]; | |||
ExecContext exec_context; | ExecContext exec_context; | |||
KillContext kill_context; | KillContext kill_context; | |||
CGroupContext cgroup_context; | CGroupContext cgroup_context; | |||
ExecRuntime *exec_runtime; | ||||
/* For Accept=no sockets refers to the one service we'll | /* For Accept=no sockets refers to the one service we'll | |||
activate. For Accept=yes sockets is either NULL, or filled | activate. For Accept=yes sockets is either NULL, or filled | |||
when the next service we spawn. */ | when the next service we spawn. */ | |||
UnitRef service; | UnitRef service; | |||
SocketState state, deserialized_state; | SocketState state, deserialized_state; | |||
Watch timer_watch; | sd_event_source *timer_event_source; | |||
ExecCommand* control_command; | ExecCommand* control_command; | |||
SocketExecCommand control_command_id; | SocketExecCommand control_command_id; | |||
pid_t control_pid; | pid_t control_pid; | |||
mode_t directory_mode; | mode_t directory_mode; | |||
mode_t socket_mode; | mode_t socket_mode; | |||
SocketResult result; | SocketResult result; | |||
char **symlinks; | ||||
bool accept; | bool accept; | |||
bool remove_on_stop; | ||||
/* Socket options */ | /* Socket options */ | |||
bool keep_alive; | bool keep_alive; | |||
bool free_bind; | bool free_bind; | |||
bool transparent; | bool transparent; | |||
bool broadcast; | bool broadcast; | |||
bool pass_cred; | bool pass_cred; | |||
bool pass_sec; | bool pass_sec; | |||
/* Only for INET6 sockets: issue IPV6_V6ONLY sockopt */ | /* Only for INET6 sockets: issue IPV6_V6ONLY sockopt */ | |||
skipping to change at line 147 | skipping to change at line 155 | |||
int priority; | int priority; | |||
int mark; | int mark; | |||
size_t receive_buffer; | size_t receive_buffer; | |||
size_t send_buffer; | size_t send_buffer; | |||
int ip_tos; | int ip_tos; | |||
int ip_ttl; | int ip_ttl; | |||
size_t pipe_size; | size_t pipe_size; | |||
char *bind_to_device; | char *bind_to_device; | |||
char *tcp_congestion; | char *tcp_congestion; | |||
bool reuseport; | bool reuse_port; | |||
long mq_maxmsg; | long mq_maxmsg; | |||
long mq_msgsize; | long mq_msgsize; | |||
char *smack; | char *smack; | |||
char *smack_ip_in; | char *smack_ip_in; | |||
char *smack_ip_out; | char *smack_ip_out; | |||
char *user, *group; | ||||
}; | }; | |||
/* Called from the service code when collecting fds */ | /* Called from the service code when collecting fds */ | |||
int socket_collect_fds(Socket *s, int **fds, unsigned *n_fds); | int socket_collect_fds(Socket *s, int **fds, unsigned *n_fds); | |||
/* Called from the service code when a per-connection service ended */ | /* Called from the service code when a per-connection service ended */ | |||
void socket_connection_unref(Socket *s); | void socket_connection_unref(Socket *s); | |||
void socket_free_ports(Socket *s); | void socket_free_ports(Socket *s); | |||
End of changes. 10 change blocks. | ||||
3 lines changed or deleted | 13 lines changed or added | |||
spawn-polkit-agent.h | spawn-polkit-agent.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foospawnpolkitagenthfoo | #pragma once | |||
#define foospawnpolkitagenthfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2012 Lennart Poettering | Copyright 2012 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. | |||
skipping to change at line 27 | skipping to change at line 26 | |||
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/>. | |||
***/ | ***/ | |||
int polkit_agent_open(void); | int polkit_agent_open(void); | |||
void polkit_agent_close(void); | void polkit_agent_close(void); | |||
#endif | ||||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added | |||
special.h | special.h | |||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
#define SPECIAL_HIBERNATE_TARGET "hibernate.target" | #define SPECIAL_HIBERNATE_TARGET "hibernate.target" | |||
#define SPECIAL_HYBRID_SLEEP_TARGET "hybrid-sleep.target" | #define SPECIAL_HYBRID_SLEEP_TARGET "hybrid-sleep.target" | |||
/* Special boot targets */ | /* Special boot targets */ | |||
#define SPECIAL_RESCUE_TARGET "rescue.target" | #define SPECIAL_RESCUE_TARGET "rescue.target" | |||
#define SPECIAL_EMERGENCY_TARGET "emergency.target" | #define SPECIAL_EMERGENCY_TARGET "emergency.target" | |||
/* Early boot targets */ | /* Early boot targets */ | |||
#define SPECIAL_SYSINIT_TARGET "sysinit.target" | #define SPECIAL_SYSINIT_TARGET "sysinit.target" | |||
#define SPECIAL_SOCKETS_TARGET "sockets.target" | #define SPECIAL_SOCKETS_TARGET "sockets.target" | |||
#define SPECIAL_BUSNAMES_TARGET "busnames.target" | ||||
#define SPECIAL_TIMERS_TARGET "timers.target" | #define SPECIAL_TIMERS_TARGET "timers.target" | |||
#define SPECIAL_PATHS_TARGET "paths.target" | #define SPECIAL_PATHS_TARGET "paths.target" | |||
#define SPECIAL_LOCAL_FS_TARGET "local-fs.target" | #define SPECIAL_LOCAL_FS_TARGET "local-fs.target" | |||
#define SPECIAL_LOCAL_FS_PRE_TARGET "local-fs-pre.target" | #define SPECIAL_LOCAL_FS_PRE_TARGET "local-fs-pre.target" | |||
#define SPECIAL_INITRD_FS_TARGET "initrd-fs.target" | #define SPECIAL_INITRD_FS_TARGET "initrd-fs.target" | |||
#define SPECIAL_INITRD_ROOT_FS_TARGET "initrd-root-fs.target" | #define SPECIAL_INITRD_ROOT_FS_TARGET "initrd-root-fs.target" | |||
#define SPECIAL_REMOTE_FS_TARGET "remote-fs.target" /* LSB's $remote_ fs */ | #define SPECIAL_REMOTE_FS_TARGET "remote-fs.target" /* LSB's $remote_ fs */ | |||
#define SPECIAL_REMOTE_FS_PRE_TARGET "remote-fs-pre.target" | #define SPECIAL_REMOTE_FS_PRE_TARGET "remote-fs-pre.target" | |||
#define SPECIAL_SWAP_TARGET "swap.target" | #define SPECIAL_SWAP_TARGET "swap.target" | |||
#define SPECIAL_NETWORK_ONLINE_TARGET "network-online.target" | #define SPECIAL_NETWORK_ONLINE_TARGET "network-online.target" | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
strv.h | strv.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
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/>. | |||
***/ | ***/ | |||
#include <stdarg.h> | #include <stdarg.h> | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include "macro.h" | #include "util.h" | |||
char *strv_find(char **l, const char *name) _pure_; | char *strv_find(char **l, const char *name) _pure_; | |||
char *strv_find_prefix(char **l, const char *name) _pure_; | char *strv_find_prefix(char **l, const char *name) _pure_; | |||
void strv_free(char **l); | void strv_free(char **l); | |||
static inline void strv_freep(char ***l) { | DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free); | |||
strv_free(*l); | ||||
} | ||||
#define _cleanup_strv_free_ _cleanup_(strv_freep) | #define _cleanup_strv_free_ _cleanup_(strv_freep) | |||
char **strv_copy(char * const *l); | char **strv_copy(char * const *l); | |||
unsigned strv_length(char * const *l) _pure_; | unsigned strv_length(char * const *l) _pure_; | |||
char **strv_merge(char **a, char **b); | int strv_extend_strv(char ***a, char **b); | |||
char **strv_merge_concat(char **a, char **b, const char *suffix); | int strv_extend_strv_concat(char ***a, char **b, const char *suffix); | |||
char **strv_append(char **l, const char *s); | ||||
int strv_extend(char ***l, const char *value); | int strv_extend(char ***l, const char *value); | |||
int strv_extendf(char ***l, const char *format, ...) _printf_(2,0); | ||||
int strv_push(char ***l, char *value); | int strv_push(char ***l, char *value); | |||
int strv_push_prepend(char ***l, char *value); | ||||
int strv_consume(char ***l, char *value); | ||||
int strv_consume_prepend(char ***l, char *value); | ||||
char **strv_remove(char **l, const char *s); | char **strv_remove(char **l, const char *s); | |||
char **strv_remove_prefix(char **l, const char *s); | ||||
char **strv_uniq(char **l); | char **strv_uniq(char **l); | |||
#define strv_contains(l, s) (!!strv_find((l), (s))) | #define strv_contains(l, s) (!!strv_find((l), (s))) | |||
char **strv_new(const char *x, ...) _sentinel_; | char **strv_new(const char *x, ...) _sentinel_; | |||
char **strv_new_ap(const char *x, va_list ap); | char **strv_new_ap(const char *x, va_list ap); | |||
static inline const char* STRV_IFNOTNULL(const char *x) { | static inline const char* STRV_IFNOTNULL(const char *x) { | |||
return x ? x : (const char *) -1; | return x ? x : (const char *) -1; | |||
} | } | |||
skipping to change at line 81 | skipping to change at line 80 | |||
char **strv_parse_nulstr(const char *s, size_t l); | char **strv_parse_nulstr(const char *s, size_t l); | |||
char **strv_split_nulstr(const char *s); | char **strv_split_nulstr(const char *s); | |||
bool strv_overlap(char **a, char **b) _pure_; | bool strv_overlap(char **a, char **b) _pure_; | |||
#define STRV_FOREACH(s, l) \ | #define STRV_FOREACH(s, l) \ | |||
for ((s) = (l); (s) && *(s); (s)++) | for ((s) = (l); (s) && *(s); (s)++) | |||
#define STRV_FOREACH_BACKWARDS(s, l) \ | #define STRV_FOREACH_BACKWARDS(s, l) \ | |||
for (; (l) && ((s) >= (l)); (s)--) | STRV_FOREACH(s, l) \ | |||
; \ | ||||
for ((s)--; (l) && ((s) >= (l)); (s)--) | ||||
#define STRV_FOREACH_PAIR(x, y, l) \ | #define STRV_FOREACH_PAIR(x, y, l) \ | |||
for ((x) = (l), (y) = (x+1); (x) && *(x) && *(y); (x) += 2, (y) = ( x + 1)) | for ((x) = (l), (y) = (x+1); (x) && *(x) && *(y); (x) += 2, (y) = ( x + 1)) | |||
char **strv_sort(char **l); | char **strv_sort(char **l); | |||
void strv_print(char **l); | void strv_print(char **l); | |||
#define STRV_MAKE(...) ((char**) ((const char*[]) { __VA_ARGS__, NULL })) | ||||
#define STRV_MAKE_EMPTY ((char*[1]) { NULL }) | ||||
#define strv_from_stdarg_alloca(first) \ | ||||
({ \ | ||||
char **_l; \ | ||||
\ | ||||
if (!first) \ | ||||
_l = (char**) &first; \ | ||||
else { \ | ||||
unsigned _n; \ | ||||
va_list _ap; \ | ||||
\ | ||||
_n = 1; \ | ||||
va_start(_ap, first); \ | ||||
while (va_arg(_ap, char*)) \ | ||||
_n++; \ | ||||
va_end(_ap); \ | ||||
\ | ||||
_l = newa(char*, _n+1); \ | ||||
_l[_n = 0] = (char*) first; \ | ||||
va_start(_ap, first); \ | ||||
for (;;) { \ | ||||
_l[++_n] = va_arg(_ap, char*); \ | ||||
if (!_l[_n]) \ | ||||
break; \ | ||||
} \ | ||||
va_end(_ap); \ | ||||
} \ | ||||
_l; \ | ||||
}) | ||||
#define STR_IN_SET(x, ...) strv_contains(STRV_MAKE(__VA_ARGS__), x) | ||||
#define FOREACH_STRING(x, ...) \ | ||||
for (char **_l = ({ \ | ||||
char **_ll = STRV_MAKE(__VA_ARGS__); \ | ||||
x = _ll ? _ll[0] : NULL; \ | ||||
_ll; \ | ||||
}); \ | ||||
_l && *_l; \ | ||||
x = ({ \ | ||||
_l ++; \ | ||||
_l[0]; \ | ||||
})) | ||||
End of changes. 8 change blocks. | ||||
10 lines changed or deleted | 11 lines changed or added | |||
strxcpyx.h | strxcpyx.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
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/>. | |||
***/ | ***/ | |||
#include <stdarg.h> | #include <stdarg.h> | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include "macro.h" | ||||
size_t strpcpy(char **dest, size_t size, const char *src); | size_t strpcpy(char **dest, size_t size, const char *src); | |||
size_t strpcpyf(char **dest, size_t size, const char *src, ...) __attribute | size_t strpcpyf(char **dest, size_t size, const char *src, ...) _printf_(3, | |||
__((format(printf, 3, 4))); | 4); | |||
size_t strpcpyl(char **dest, size_t size, const char *src, ...) __attribute | size_t strpcpyl(char **dest, size_t size, const char *src, ...) _sentinel_; | |||
__((sentinel)); | ||||
size_t strscpy(char *dest, size_t size, const char *src); | size_t strscpy(char *dest, size_t size, const char *src); | |||
size_t strscpyl(char *dest, size_t size, const char *src, ...) __attribute_ _((sentinel)); | size_t strscpyl(char *dest, size_t size, const char *src, ...) _sentinel_; | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 5 lines changed or added | |||
swap.h | swap.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/>. | |||
***/ | ***/ | |||
#include <libudev.h> | ||||
typedef struct Swap Swap; | typedef struct Swap Swap; | |||
#include "unit.h" | #include "unit.h" | |||
typedef enum SwapState { | typedef enum SwapState { | |||
SWAP_DEAD, | SWAP_DEAD, | |||
SWAP_ACTIVATING, | SWAP_ACTIVATING, /* /sbin/swapon is running, but the | |||
swap not yet enabled. */ | ||||
SWAP_ACTIVATING_DONE, /* /sbin/swapon is running, and the | ||||
swap is done. */ | ||||
SWAP_ACTIVE, | SWAP_ACTIVE, | |||
SWAP_DEACTIVATING, | SWAP_DEACTIVATING, | |||
SWAP_ACTIVATING_SIGTERM, | SWAP_ACTIVATING_SIGTERM, | |||
SWAP_ACTIVATING_SIGKILL, | SWAP_ACTIVATING_SIGKILL, | |||
SWAP_DEACTIVATING_SIGTERM, | SWAP_DEACTIVATING_SIGTERM, | |||
SWAP_DEACTIVATING_SIGKILL, | SWAP_DEACTIVATING_SIGKILL, | |||
SWAP_FAILED, | SWAP_FAILED, | |||
_SWAP_STATE_MAX, | _SWAP_STATE_MAX, | |||
_SWAP_STATE_INVALID = -1 | _SWAP_STATE_INVALID = -1 | |||
} SwapState; | } SwapState; | |||
typedef enum SwapExecCommand { | typedef enum SwapExecCommand { | |||
SWAP_EXEC_ACTIVATE, | SWAP_EXEC_ACTIVATE, | |||
SWAP_EXEC_DEACTIVATE, | SWAP_EXEC_DEACTIVATE, | |||
_SWAP_EXEC_COMMAND_MAX, | _SWAP_EXEC_COMMAND_MAX, | |||
_SWAP_EXEC_COMMAND_INVALID = -1 | _SWAP_EXEC_COMMAND_INVALID = -1 | |||
} SwapExecCommand; | } SwapExecCommand; | |||
typedef struct SwapParameters { | ||||
char *what; | ||||
int priority; | ||||
bool noauto:1; | ||||
bool nofail:1; | ||||
} SwapParameters; | ||||
typedef enum SwapResult { | typedef enum SwapResult { | |||
SWAP_SUCCESS, | SWAP_SUCCESS, | |||
SWAP_FAILURE_RESOURCES, | SWAP_FAILURE_RESOURCES, | |||
SWAP_FAILURE_TIMEOUT, | SWAP_FAILURE_TIMEOUT, | |||
SWAP_FAILURE_EXIT_CODE, | SWAP_FAILURE_EXIT_CODE, | |||
SWAP_FAILURE_SIGNAL, | SWAP_FAILURE_SIGNAL, | |||
SWAP_FAILURE_CORE_DUMP, | SWAP_FAILURE_CORE_DUMP, | |||
_SWAP_RESULT_MAX, | _SWAP_RESULT_MAX, | |||
_SWAP_RESULT_INVALID = -1 | _SWAP_RESULT_INVALID = -1 | |||
} SwapResult; | } SwapResult; | |||
typedef struct SwapParameters { | ||||
char *what; | ||||
int priority; | ||||
bool noauto:1; | ||||
bool nofail:1; | ||||
} SwapParameters; | ||||
struct Swap { | struct Swap { | |||
Unit meta; | Unit meta; | |||
char *what; | char *what; | |||
/* If the device has already shown up, this is the device | ||||
* node, which might be different from what, due to | ||||
* symlinks */ | ||||
char *devnode; | ||||
SwapParameters parameters_proc_swaps; | SwapParameters parameters_proc_swaps; | |||
SwapParameters parameters_fragment; | SwapParameters parameters_fragment; | |||
bool from_proc_swaps:1; | bool from_proc_swaps:1; | |||
bool from_fragment:1; | bool from_fragment:1; | |||
/* Used while looking for swaps that vanished or got added | /* Used while looking for swaps that vanished or got added | |||
* from/to /proc/swaps */ | * from/to /proc/swaps */ | |||
bool is_active:1; | bool is_active:1; | |||
bool just_activated:1; | bool just_activated:1; | |||
SwapResult result; | SwapResult result; | |||
usec_t timeout_usec; | usec_t timeout_usec; | |||
ExecCommand exec_command[_SWAP_EXEC_COMMAND_MAX]; | ExecCommand exec_command[_SWAP_EXEC_COMMAND_MAX]; | |||
ExecContext exec_context; | ExecContext exec_context; | |||
KillContext kill_context; | KillContext kill_context; | |||
CGroupContext cgroup_context; | CGroupContext cgroup_context; | |||
ExecRuntime *exec_runtime; | ||||
SwapState state, deserialized_state; | SwapState state, deserialized_state; | |||
ExecCommand* control_command; | ExecCommand* control_command; | |||
SwapExecCommand control_command_id; | SwapExecCommand control_command_id; | |||
pid_t control_pid; | pid_t control_pid; | |||
Watch timer_watch; | sd_event_source *timer_event_source; | |||
/* In order to be able to distinguish dependencies on | /* In order to be able to distinguish dependencies on | |||
different device nodes we might end up creating multiple | different device nodes we might end up creating multiple | |||
devices for the same swap. We chain them up here. */ | devices for the same swap. We chain them up here. */ | |||
LIST_FIELDS(struct Swap, same_proc_swaps); | LIST_FIELDS(struct Swap, same_devnode); | |||
}; | }; | |||
extern const UnitVTable swap_vtable; | extern const UnitVTable swap_vtable; | |||
int swap_dispatch_reload(Manager *m); | int swap_process_new_device(Manager *m, struct udev_device *dev); | |||
int swap_fd_event(Manager *m, int events); | int swap_process_removed_device(Manager *m, struct udev_device *dev); | |||
const char* swap_state_to_string(SwapState i) _const_; | const char* swap_state_to_string(SwapState i) _const_; | |||
SwapState swap_state_from_string(const char *s) _pure_; | SwapState swap_state_from_string(const char *s) _pure_; | |||
const char* swap_exec_command_to_string(SwapExecCommand i) _const_; | const char* swap_exec_command_to_string(SwapExecCommand i) _const_; | |||
SwapExecCommand swap_exec_command_from_string(const char *s) _pure_; | SwapExecCommand swap_exec_command_from_string(const char *s) _pure_; | |||
const char* swap_result_to_string(SwapResult i) _const_; | const char* swap_result_to_string(SwapResult i) _const_; | |||
SwapResult swap_result_from_string(const char *s) _pure_; | SwapResult swap_result_from_string(const char *s) _pure_; | |||
End of changes. 9 change blocks. | ||||
12 lines changed or deleted | 24 lines changed or added | |||
switch-root.h | switch-root.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooswitchroothfoo | #pragma once | |||
#define fooswitchroothfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2012 Harald Hoyer, Lennart Poettering | Copyright 2012 Harald Hoyer, 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. | |||
skipping to change at line 26 | 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/>. | |||
***/ | ***/ | |||
int switch_root(const char *switch_root); | int switch_root(const char *switch_root); | |||
#endif | ||||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added | |||
test-helper.h | test-helper.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
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/>. | |||
***/ | ***/ | |||
#include "sd-daemon.h" | #include "sd-daemon.h" | |||
#define TEST_REQ_RUNNING_SYSTEMD(x) \ | #define TEST_REQ_RUNNING_SYSTEMD(x) \ | |||
if (sd_booted() > 0) { \ | if (sd_booted() > 0) { \ | |||
x; \ | x; \ | |||
} else { \ | } else { \ | |||
printf("systemd not booted skipping '%s'\n", #x); \ | printf("systemd not booted skipping '%s'\n", #x); \ | |||
} | } | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
time-util.h | time-util.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 <stdio.h> | #include <stdio.h> | |||
#include <inttypes.h> | #include <inttypes.h> | |||
typedef uint64_t usec_t; | typedef uint64_t usec_t; | |||
typedef uint64_t nsec_t; | typedef uint64_t nsec_t; | |||
#define NSEC_FMT "%" PRIu64 | ||||
#define USEC_FMT "%" PRIu64 | ||||
#include "macro.h" | #include "macro.h" | |||
typedef struct dual_timestamp { | typedef struct dual_timestamp { | |||
usec_t realtime; | usec_t realtime; | |||
usec_t monotonic; | usec_t monotonic; | |||
} dual_timestamp; | } dual_timestamp; | |||
#define MSEC_PER_SEC 1000ULL | #define MSEC_PER_SEC ((usec_t) 1000ULL) | |||
#define USEC_PER_SEC 1000000ULL | #define USEC_PER_SEC ((usec_t) 1000000ULL) | |||
#define USEC_PER_MSEC 1000ULL | #define USEC_PER_MSEC ((usec_t) 1000ULL) | |||
#define NSEC_PER_SEC 1000000000ULL | #define NSEC_PER_SEC ((usec_t) 1000000000ULL) | |||
#define NSEC_PER_MSEC 1000000ULL | #define NSEC_PER_MSEC ((usec_t) 1000000ULL) | |||
#define NSEC_PER_USEC 1000ULL | #define NSEC_PER_USEC ((usec_t) 1000ULL) | |||
#define USEC_PER_MINUTE (60ULL*USEC_PER_SEC) | #define USEC_PER_MINUTE ((usec_t) (60ULL*USEC_PER_SEC)) | |||
#define NSEC_PER_MINUTE (60ULL*NSEC_PER_SEC) | #define NSEC_PER_MINUTE ((usec_t) (60ULL*NSEC_PER_SEC)) | |||
#define USEC_PER_HOUR (60ULL*USEC_PER_MINUTE) | #define USEC_PER_HOUR ((usec_t) (60ULL*USEC_PER_MINUTE)) | |||
#define NSEC_PER_HOUR (60ULL*NSEC_PER_MINUTE) | #define NSEC_PER_HOUR ((usec_t) (60ULL*NSEC_PER_MINUTE)) | |||
#define USEC_PER_DAY (24ULL*USEC_PER_HOUR) | #define USEC_PER_DAY ((usec_t) (24ULL*USEC_PER_HOUR)) | |||
#define NSEC_PER_DAY (24ULL*NSEC_PER_HOUR) | #define NSEC_PER_DAY ((usec_t) (24ULL*NSEC_PER_HOUR)) | |||
#define USEC_PER_WEEK (7ULL*USEC_PER_DAY) | #define USEC_PER_WEEK ((usec_t) (7ULL*USEC_PER_DAY)) | |||
#define NSEC_PER_WEEK (7ULL*NSEC_PER_DAY) | #define NSEC_PER_WEEK ((usec_t) (7ULL*NSEC_PER_DAY)) | |||
#define USEC_PER_MONTH (2629800ULL*USEC_PER_SEC) | #define USEC_PER_MONTH ((usec_t) (2629800ULL*USEC_PER_SEC)) | |||
#define NSEC_PER_MONTH (2629800ULL*NSEC_PER_SEC) | #define NSEC_PER_MONTH ((usec_t) (2629800ULL*NSEC_PER_SEC)) | |||
#define USEC_PER_YEAR (31557600ULL*USEC_PER_SEC) | #define USEC_PER_YEAR ((usec_t) (31557600ULL*USEC_PER_SEC)) | |||
#define NSEC_PER_YEAR (31557600ULL*NSEC_PER_SEC) | #define NSEC_PER_YEAR ((usec_t) (31557600ULL*NSEC_PER_SEC)) | |||
#define FORMAT_TIMESTAMP_MAX ((4*4+1)+11+9+4+1) /* weekdays can be unicode */ | #define FORMAT_TIMESTAMP_MAX ((4*4+1)+11+9+4+1) /* weekdays can be unicode */ | |||
#define FORMAT_TIMESTAMP_WIDTH 28 /* when outputting, assume this width */ | ||||
#define FORMAT_TIMESTAMP_RELATIVE_MAX 256 | #define FORMAT_TIMESTAMP_RELATIVE_MAX 256 | |||
#define FORMAT_TIMESPAN_MAX 64 | #define FORMAT_TIMESPAN_MAX 64 | |||
#define DUAL_TIMESTAMP_NULL ((struct dual_timestamp) { 0, 0 }) | ||||
usec_t now(clockid_t clock); | usec_t now(clockid_t clock); | |||
dual_timestamp* dual_timestamp_get(dual_timestamp *ts); | dual_timestamp* dual_timestamp_get(dual_timestamp *ts); | |||
dual_timestamp* dual_timestamp_from_realtime(dual_timestamp *ts, usec_t u); | dual_timestamp* dual_timestamp_from_realtime(dual_timestamp *ts, usec_t u); | |||
dual_timestamp* dual_timestamp_from_monotonic(dual_timestamp *ts, usec_t u) ; | dual_timestamp* dual_timestamp_from_monotonic(dual_timestamp *ts, usec_t u) ; | |||
#define dual_timestamp_is_set(ts) ((ts)->realtime > 0) | static inline bool dual_timestamp_is_set(dual_timestamp *ts) { | |||
return ((ts->realtime > 0 && ts->realtime != (usec_t) -1) || | ||||
(ts->monotonic > 0 && ts->monotonic != (usec_t) -1)); | ||||
} | ||||
usec_t timespec_load(const struct timespec *ts) _pure_; | usec_t timespec_load(const struct timespec *ts) _pure_; | |||
struct timespec *timespec_store(struct timespec *ts, usec_t u); | struct timespec *timespec_store(struct timespec *ts, usec_t u); | |||
usec_t timeval_load(const struct timeval *tv) _pure_; | usec_t timeval_load(const struct timeval *tv) _pure_; | |||
struct timeval *timeval_store(struct timeval *tv, usec_t u); | struct timeval *timeval_store(struct timeval *tv, usec_t u); | |||
char *format_timestamp(char *buf, size_t l, usec_t t); | char *format_timestamp(char *buf, size_t l, usec_t t); | |||
char *format_timestamp_us(char *buf, size_t l, usec_t t); | char *format_timestamp_us(char *buf, size_t l, usec_t t); | |||
char *format_timestamp_relative(char *buf, size_t l, usec_t t); | char *format_timestamp_relative(char *buf, size_t l, usec_t t); | |||
char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy); | char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy); | |||
void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t) ; | void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t) ; | |||
void dual_timestamp_deserialize(const char *value, dual_timestamp *t); | void dual_timestamp_deserialize(const char *value, dual_timestamp *t); | |||
int parse_timestamp(const char *t, usec_t *usec); | int parse_timestamp(const char *t, usec_t *usec); | |||
int parse_sec(const char *t, usec_t *usec); | int parse_sec(const char *t, usec_t *usec); | |||
int parse_nsec(const char *t, nsec_t *nsec); | int parse_nsec(const char *t, nsec_t *nsec); | |||
bool ntp_synced(void); | ||||
End of changes. 6 change blocks. | ||||
20 lines changed or deleted | 29 lines changed or added | |||
timer.h | timer.h | |||
---|---|---|---|---|
skipping to change at line 53 | skipping to change at line 53 | |||
TIMER_UNIT_ACTIVE, | TIMER_UNIT_ACTIVE, | |||
TIMER_UNIT_INACTIVE, | TIMER_UNIT_INACTIVE, | |||
TIMER_CALENDAR, | TIMER_CALENDAR, | |||
_TIMER_BASE_MAX, | _TIMER_BASE_MAX, | |||
_TIMER_BASE_INVALID = -1 | _TIMER_BASE_INVALID = -1 | |||
} TimerBase; | } TimerBase; | |||
typedef struct TimerValue { | typedef struct TimerValue { | |||
TimerBase base; | TimerBase base; | |||
bool disabled; | bool disabled; | |||
clockid_t clock_id; | ||||
usec_t value; /* only for monotonic events */ | usec_t value; /* only for monotonic events */ | |||
CalendarSpec *calendar_spec; /* only for calendar events */ | CalendarSpec *calendar_spec; /* only for calendar events */ | |||
usec_t next_elapse; | usec_t next_elapse; | |||
LIST_FIELDS(struct TimerValue, value); | LIST_FIELDS(struct TimerValue, value); | |||
} TimerValue; | } TimerValue; | |||
typedef enum TimerResult { | typedef enum TimerResult { | |||
TIMER_SUCCESS, | TIMER_SUCCESS, | |||
TIMER_FAILURE_RESOURCES, | TIMER_FAILURE_RESOURCES, | |||
_TIMER_RESULT_MAX, | _TIMER_RESULT_MAX, | |||
_TIMER_RESULT_INVALID = -1 | _TIMER_RESULT_INVALID = -1 | |||
} TimerResult; | } TimerResult; | |||
struct Timer { | struct Timer { | |||
Unit meta; | Unit meta; | |||
usec_t accuracy_usec; | ||||
LIST_HEAD(TimerValue, values); | LIST_HEAD(TimerValue, values); | |||
usec_t next_elapse_monotonic; | ||||
usec_t next_elapse_realtime; | usec_t next_elapse_realtime; | |||
usec_t next_elapse_monotonic_or_boottime; | ||||
dual_timestamp last_trigger; | ||||
TimerState state, deserialized_state; | TimerState state, deserialized_state; | |||
Watch monotonic_watch; | sd_event_source *monotonic_event_source; | |||
Watch realtime_watch; | sd_event_source *realtime_event_source; | |||
TimerResult result; | TimerResult result; | |||
usec_t last_trigger_monotonic; | bool persistent; | |||
bool wake_system; | ||||
char *stamp_path; | ||||
}; | }; | |||
void timer_free_values(Timer *t); | void timer_free_values(Timer *t); | |||
extern const UnitVTable timer_vtable; | extern const UnitVTable timer_vtable; | |||
const char *timer_state_to_string(TimerState i) _const_; | const char *timer_state_to_string(TimerState i) _const_; | |||
TimerState timer_state_from_string(const char *s) _pure_; | TimerState timer_state_from_string(const char *s) _pure_; | |||
const char *timer_base_to_string(TimerBase i) _const_; | const char *timer_base_to_string(TimerBase i) _const_; | |||
End of changes. 6 change blocks. | ||||
5 lines changed or deleted | 10 lines changed or added | |||
transaction.h | transaction.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef footransactionhfoo | #pragma once | |||
#define footransactionhfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2010 Lennart Poettering | Copyright 2010 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. | |||
skipping to change at line 52 | skipping to change at line 51 | |||
int transaction_add_job_and_dependencies( | int transaction_add_job_and_dependencies( | |||
Transaction *tr, | Transaction *tr, | |||
JobType type, | JobType type, | |||
Unit *unit, | Unit *unit, | |||
Job *by, | Job *by, | |||
bool matters, | bool matters, | |||
bool override, | bool override, | |||
bool conflicts, | bool conflicts, | |||
bool ignore_requirements, | bool ignore_requirements, | |||
bool ignore_order, | bool ignore_order, | |||
DBusError *e); | sd_bus_error *e); | |||
int transaction_activate(Transaction *tr, Manager *m, JobMode mode, DBusErr | int transaction_activate(Transaction *tr, Manager *m, JobMode mode, sd_bus_ | |||
or *e); | error *e); | |||
int transaction_add_isolate_jobs(Transaction *tr, Manager *m); | int transaction_add_isolate_jobs(Transaction *tr, Manager *m); | |||
void transaction_abort(Transaction *tr); | void transaction_abort(Transaction *tr); | |||
#endif | ||||
End of changes. 3 change blocks. | ||||
5 lines changed or deleted | 4 lines changed or added | |||
udev.h | udev.h | |||
---|---|---|---|---|
skipping to change at line 42 | skipping to change at line 42 | |||
struct udev_event { | struct udev_event { | |||
struct udev *udev; | struct udev *udev; | |||
struct udev_device *dev; | struct udev_device *dev; | |||
struct udev_device *dev_parent; | struct udev_device *dev_parent; | |||
struct udev_device *dev_db; | struct udev_device *dev_db; | |||
char *name; | char *name; | |||
char *program_result; | char *program_result; | |||
mode_t mode; | mode_t mode; | |||
uid_t uid; | uid_t uid; | |||
gid_t gid; | gid_t gid; | |||
struct udev_list seclabel_list; | ||||
struct udev_list run_list; | struct udev_list run_list; | |||
int exec_delay; | int exec_delay; | |||
usec_t birth_usec; | usec_t birth_usec; | |||
usec_t timeout_usec; | usec_t timeout_usec; | |||
int fd_signal; | int fd_signal; | |||
unsigned int builtin_run; | unsigned int builtin_run; | |||
unsigned int builtin_ret; | unsigned int builtin_ret; | |||
bool sigterm; | bool sigterm; | |||
bool inotify_watch; | bool inotify_watch; | |||
bool inotify_watch_final; | bool inotify_watch_final; | |||
skipping to change at line 86 | skipping to change at line 87 | |||
/* udev-event.c */ | /* udev-event.c */ | |||
struct udev_event *udev_event_new(struct udev_device *dev); | struct udev_event *udev_event_new(struct udev_device *dev); | |||
void udev_event_unref(struct udev_event *event); | void udev_event_unref(struct udev_event *event); | |||
size_t udev_event_apply_format(struct udev_event *event, const char *src, c har *dest, size_t size); | size_t udev_event_apply_format(struct udev_event *event, const char *src, c har *dest, size_t size); | |||
int udev_event_apply_subsys_kernel(struct udev_event *event, const char *st ring, | int udev_event_apply_subsys_kernel(struct udev_event *event, const char *st ring, | |||
char *result, size_t maxsize, int read_v alue); | char *result, size_t maxsize, int read_v alue); | |||
int udev_event_spawn(struct udev_event *event, | int udev_event_spawn(struct udev_event *event, | |||
const char *cmd, char **envp, const sigset_t *sigmask, | const char *cmd, char **envp, const sigset_t *sigmask, | |||
char *result, size_t ressize); | char *result, size_t ressize); | |||
int udev_event_execute_rules(struct udev_event *event, struct udev_rules *r ules, const sigset_t *sigset); | void udev_event_execute_rules(struct udev_event *event, struct udev_rules * rules, const sigset_t *sigset); | |||
void udev_event_execute_run(struct udev_event *event, const sigset_t *sigse t); | void udev_event_execute_run(struct udev_event *event, const sigset_t *sigse t); | |||
int udev_build_argv(struct udev *udev, char *cmd, int *argc, char *argv[]); | int udev_build_argv(struct udev *udev, char *cmd, int *argc, char *argv[]); | |||
/* udev-watch.c */ | /* udev-watch.c */ | |||
int udev_watch_init(struct udev *udev); | int udev_watch_init(struct udev *udev); | |||
void udev_watch_restore(struct udev *udev); | void udev_watch_restore(struct udev *udev); | |||
void udev_watch_begin(struct udev *udev, struct udev_device *dev); | void udev_watch_begin(struct udev *udev, struct udev_device *dev); | |||
void udev_watch_end(struct udev *udev, struct udev_device *dev); | void udev_watch_end(struct udev *udev, struct udev_device *dev); | |||
struct udev_device *udev_watch_lookup(struct udev *udev, int wd); | struct udev_device *udev_watch_lookup(struct udev *udev, int wd); | |||
/* udev-node.c */ | /* udev-node.c */ | |||
void udev_node_add(struct udev_device *dev, bool apply, mode_t mode, uid_t | void udev_node_add(struct udev_device *dev, bool apply, | |||
uid, gid_t gid); | mode_t mode, uid_t uid, gid_t gid, | |||
struct udev_list *seclabel_list); | ||||
void udev_node_remove(struct udev_device *dev); | void udev_node_remove(struct udev_device *dev); | |||
void udev_node_update_old_links(struct udev_device *dev, struct udev_device *dev_old); | void udev_node_update_old_links(struct udev_device *dev, struct udev_device *dev_old); | |||
/* udev-ctrl.c */ | /* udev-ctrl.c */ | |||
struct udev_ctrl; | struct udev_ctrl; | |||
struct udev_ctrl *udev_ctrl_new(struct udev *udev); | struct udev_ctrl *udev_ctrl_new(struct udev *udev); | |||
struct udev_ctrl *udev_ctrl_new_from_fd(struct udev *udev, int fd); | struct udev_ctrl *udev_ctrl_new_from_fd(struct udev *udev, int fd); | |||
int udev_ctrl_enable_receiving(struct udev_ctrl *uctrl); | int udev_ctrl_enable_receiving(struct udev_ctrl *uctrl); | |||
struct udev_ctrl *udev_ctrl_ref(struct udev_ctrl *uctrl); | ||||
struct udev_ctrl *udev_ctrl_unref(struct udev_ctrl *uctrl); | struct udev_ctrl *udev_ctrl_unref(struct udev_ctrl *uctrl); | |||
int udev_ctrl_cleanup(struct udev_ctrl *uctrl); | int udev_ctrl_cleanup(struct udev_ctrl *uctrl); | |||
struct udev *udev_ctrl_get_udev(struct udev_ctrl *uctrl); | struct udev *udev_ctrl_get_udev(struct udev_ctrl *uctrl); | |||
int udev_ctrl_get_fd(struct udev_ctrl *uctrl); | int udev_ctrl_get_fd(struct udev_ctrl *uctrl); | |||
int udev_ctrl_send_set_log_level(struct udev_ctrl *uctrl, int priority, int timeout); | int udev_ctrl_send_set_log_level(struct udev_ctrl *uctrl, int priority, int timeout); | |||
int udev_ctrl_send_stop_exec_queue(struct udev_ctrl *uctrl, int timeout); | int udev_ctrl_send_stop_exec_queue(struct udev_ctrl *uctrl, int timeout); | |||
int udev_ctrl_send_start_exec_queue(struct udev_ctrl *uctrl, int timeout); | int udev_ctrl_send_start_exec_queue(struct udev_ctrl *uctrl, int timeout); | |||
int udev_ctrl_send_reload(struct udev_ctrl *uctrl, int timeout); | int udev_ctrl_send_reload(struct udev_ctrl *uctrl, int timeout); | |||
int udev_ctrl_send_ping(struct udev_ctrl *uctrl, int timeout); | int udev_ctrl_send_ping(struct udev_ctrl *uctrl, int timeout); | |||
int udev_ctrl_send_exit(struct udev_ctrl *uctrl, int timeout); | int udev_ctrl_send_exit(struct udev_ctrl *uctrl, int timeout); | |||
int udev_ctrl_send_set_env(struct udev_ctrl *uctrl, const char *key, int ti meout); | int udev_ctrl_send_set_env(struct udev_ctrl *uctrl, const char *key, int ti meout); | |||
int udev_ctrl_send_set_children_max(struct udev_ctrl *uctrl, int count, int timeout); | int udev_ctrl_send_set_children_max(struct udev_ctrl *uctrl, int count, int timeout); | |||
struct udev_ctrl_connection; | struct udev_ctrl_connection; | |||
struct udev_ctrl_connection *udev_ctrl_get_connection(struct udev_ctrl *uct rl); | struct udev_ctrl_connection *udev_ctrl_get_connection(struct udev_ctrl *uct rl); | |||
struct udev_ctrl_connection *udev_ctrl_connection_ref(struct udev_ctrl_conn ection *conn); | struct udev_ctrl_connection *udev_ctrl_connection_ref(struct udev_ctrl_conn ection *conn); | |||
struct udev_ctrl_connection *udev_ctrl_connection_unref(struct udev_ctrl_co nnection *conn); | struct udev_ctrl_connection *udev_ctrl_connection_unref(struct udev_ctrl_co nnection *conn); | |||
struct udev_ctrl_msg; | struct udev_ctrl_msg; | |||
struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *co nn); | struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *co nn); | |||
struct udev_ctrl_msg *udev_ctrl_msg_ref(struct udev_ctrl_msg *ctrl_msg); | ||||
struct udev_ctrl_msg *udev_ctrl_msg_unref(struct udev_ctrl_msg *ctrl_msg); | struct udev_ctrl_msg *udev_ctrl_msg_unref(struct udev_ctrl_msg *ctrl_msg); | |||
int udev_ctrl_get_set_log_level(struct udev_ctrl_msg *ctrl_msg); | int udev_ctrl_get_set_log_level(struct udev_ctrl_msg *ctrl_msg); | |||
int udev_ctrl_get_stop_exec_queue(struct udev_ctrl_msg *ctrl_msg); | int udev_ctrl_get_stop_exec_queue(struct udev_ctrl_msg *ctrl_msg); | |||
int udev_ctrl_get_start_exec_queue(struct udev_ctrl_msg *ctrl_msg); | int udev_ctrl_get_start_exec_queue(struct udev_ctrl_msg *ctrl_msg); | |||
int udev_ctrl_get_reload(struct udev_ctrl_msg *ctrl_msg); | int udev_ctrl_get_reload(struct udev_ctrl_msg *ctrl_msg); | |||
int udev_ctrl_get_ping(struct udev_ctrl_msg *ctrl_msg); | int udev_ctrl_get_ping(struct udev_ctrl_msg *ctrl_msg); | |||
int udev_ctrl_get_exit(struct udev_ctrl_msg *ctrl_msg); | int udev_ctrl_get_exit(struct udev_ctrl_msg *ctrl_msg); | |||
const char *udev_ctrl_get_set_env(struct udev_ctrl_msg *ctrl_msg); | const char *udev_ctrl_get_set_env(struct udev_ctrl_msg *ctrl_msg); | |||
int udev_ctrl_get_set_children_max(struct udev_ctrl_msg *ctrl_msg); | int udev_ctrl_get_set_children_max(struct udev_ctrl_msg *ctrl_msg); | |||
skipping to change at line 153 | skipping to change at line 154 | |||
#ifdef HAVE_FIRMWARE | #ifdef HAVE_FIRMWARE | |||
UDEV_BUILTIN_FIRMWARE, | UDEV_BUILTIN_FIRMWARE, | |||
#endif | #endif | |||
UDEV_BUILTIN_HWDB, | UDEV_BUILTIN_HWDB, | |||
UDEV_BUILTIN_INPUT_ID, | UDEV_BUILTIN_INPUT_ID, | |||
UDEV_BUILTIN_KEYBOARD, | UDEV_BUILTIN_KEYBOARD, | |||
#ifdef HAVE_KMOD | #ifdef HAVE_KMOD | |||
UDEV_BUILTIN_KMOD, | UDEV_BUILTIN_KMOD, | |||
#endif | #endif | |||
UDEV_BUILTIN_NET_ID, | UDEV_BUILTIN_NET_ID, | |||
UDEV_BUILTIN_NET_LINK, | ||||
UDEV_BUILTIN_PATH_ID, | UDEV_BUILTIN_PATH_ID, | |||
UDEV_BUILTIN_USB_ID, | UDEV_BUILTIN_USB_ID, | |||
#ifdef HAVE_ACL | #ifdef HAVE_ACL | |||
UDEV_BUILTIN_UACCESS, | UDEV_BUILTIN_UACCESS, | |||
#endif | #endif | |||
UDEV_BUILTIN_MAX | UDEV_BUILTIN_MAX | |||
}; | }; | |||
struct udev_builtin { | struct udev_builtin { | |||
const char *name; | const char *name; | |||
int (*cmd)(struct udev_device *dev, int argc, char *argv[], bool te st); | int (*cmd)(struct udev_device *dev, int argc, char *argv[], bool te st); | |||
skipping to change at line 183 | skipping to change at line 185 | |||
#ifdef HAVE_FIRMWARE | #ifdef HAVE_FIRMWARE | |||
extern const struct udev_builtin udev_builtin_firmware; | extern const struct udev_builtin udev_builtin_firmware; | |||
#endif | #endif | |||
extern const struct udev_builtin udev_builtin_hwdb; | extern const struct udev_builtin udev_builtin_hwdb; | |||
extern const struct udev_builtin udev_builtin_input_id; | extern const struct udev_builtin udev_builtin_input_id; | |||
extern const struct udev_builtin udev_builtin_keyboard; | extern const struct udev_builtin udev_builtin_keyboard; | |||
#ifdef HAVE_KMOD | #ifdef HAVE_KMOD | |||
extern const struct udev_builtin udev_builtin_kmod; | extern const struct udev_builtin udev_builtin_kmod; | |||
#endif | #endif | |||
extern const struct udev_builtin udev_builtin_net_id; | extern const struct udev_builtin udev_builtin_net_id; | |||
extern const struct udev_builtin udev_builtin_net_setup_link; | ||||
extern const struct udev_builtin udev_builtin_path_id; | extern const struct udev_builtin udev_builtin_path_id; | |||
extern const struct udev_builtin udev_builtin_usb_id; | extern const struct udev_builtin udev_builtin_usb_id; | |||
extern const struct udev_builtin udev_builtin_uaccess; | extern const struct udev_builtin udev_builtin_uaccess; | |||
void udev_builtin_init(struct udev *udev); | void udev_builtin_init(struct udev *udev); | |||
void udev_builtin_exit(struct udev *udev); | void udev_builtin_exit(struct udev *udev); | |||
enum udev_builtin_cmd udev_builtin_lookup(const char *command); | enum udev_builtin_cmd udev_builtin_lookup(const char *command); | |||
const char *udev_builtin_name(enum udev_builtin_cmd cmd); | const char *udev_builtin_name(enum udev_builtin_cmd cmd); | |||
bool udev_builtin_run_once(enum udev_builtin_cmd cmd); | bool udev_builtin_run_once(enum udev_builtin_cmd cmd); | |||
int udev_builtin_run(struct udev_device *dev, enum udev_builtin_cmd cmd, co nst char *command, bool test); | int udev_builtin_run(struct udev_device *dev, enum udev_builtin_cmd cmd, co nst char *command, bool test); | |||
void udev_builtin_list(struct udev *udev); | void udev_builtin_list(struct udev *udev); | |||
bool udev_builtin_validate(struct udev *udev); | bool udev_builtin_validate(struct udev *udev); | |||
int udev_builtin_add_property(struct udev_device *dev, bool test, const cha r *key, const char *val); | int udev_builtin_add_property(struct udev_device *dev, bool test, const cha r *key, const char *val); | |||
int udev_builtin_hwdb_lookup(struct udev_device *dev, const char *prefix, c onst char *modalias, | int udev_builtin_hwdb_lookup(struct udev_device *dev, const char *prefix, c onst char *modalias, | |||
const char *filter, bool test); | const char *filter, bool test); | |||
/* udev logging */ | /* udev logging */ | |||
void udev_main_log(struct udev *udev, int priority, | void udev_main_log(struct udev *udev, int priority, | |||
const char *file, int line, const char *fn, | const char *file, int line, const char *fn, | |||
const char *format, va_list args) _printf_attr_(6, 0); | const char *format, va_list args) _printf_(6, 0); | |||
/* udevadm commands */ | /* udevadm commands */ | |||
struct udevadm_cmd { | struct udevadm_cmd { | |||
const char *name; | const char *name; | |||
int (*cmd)(struct udev *udev, int argc, char *argv[]); | int (*cmd)(struct udev *udev, int argc, char *argv[]); | |||
const char *help; | const char *help; | |||
int debug; | int debug; | |||
}; | }; | |||
extern const struct udevadm_cmd udevadm_info; | extern const struct udevadm_cmd udevadm_info; | |||
extern const struct udevadm_cmd udevadm_trigger; | extern const struct udevadm_cmd udevadm_trigger; | |||
End of changes. 8 change blocks. | ||||
6 lines changed or deleted | 8 lines changed or added | |||
unit-name.h | unit-name.h | |||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
#include "macro.h" | #include "macro.h" | |||
#define UNIT_NAME_MAX 256 | #define UNIT_NAME_MAX 256 | |||
typedef enum UnitType UnitType; | typedef enum UnitType UnitType; | |||
typedef enum UnitLoadState UnitLoadState; | typedef enum UnitLoadState UnitLoadState; | |||
enum UnitType { | enum UnitType { | |||
UNIT_SERVICE = 0, | UNIT_SERVICE = 0, | |||
UNIT_SOCKET, | UNIT_SOCKET, | |||
UNIT_BUSNAME, | ||||
UNIT_TARGET, | UNIT_TARGET, | |||
UNIT_SNAPSHOT, | ||||
UNIT_DEVICE, | UNIT_DEVICE, | |||
UNIT_MOUNT, | UNIT_MOUNT, | |||
UNIT_AUTOMOUNT, | UNIT_AUTOMOUNT, | |||
UNIT_SNAPSHOT, | ||||
UNIT_TIMER, | ||||
UNIT_SWAP, | UNIT_SWAP, | |||
UNIT_TIMER, | ||||
UNIT_PATH, | UNIT_PATH, | |||
UNIT_SLICE, | UNIT_SLICE, | |||
UNIT_SCOPE, | UNIT_SCOPE, | |||
_UNIT_TYPE_MAX, | _UNIT_TYPE_MAX, | |||
_UNIT_TYPE_INVALID = -1 | _UNIT_TYPE_INVALID = -1 | |||
}; | }; | |||
enum UnitLoadState { | enum UnitLoadState { | |||
UNIT_STUB = 0, | UNIT_STUB = 0, | |||
UNIT_LOADED, | UNIT_LOADED, | |||
skipping to change at line 71 | skipping to change at line 72 | |||
const char *unit_type_to_string(UnitType i) _const_; | const char *unit_type_to_string(UnitType i) _const_; | |||
UnitType unit_type_from_string(const char *s) _pure_; | UnitType unit_type_from_string(const char *s) _pure_; | |||
const char *unit_load_state_to_string(UnitLoadState i) _const_; | const char *unit_load_state_to_string(UnitLoadState i) _const_; | |||
UnitLoadState unit_load_state_from_string(const char *s) _pure_; | UnitLoadState unit_load_state_from_string(const char *s) _pure_; | |||
int unit_name_to_instance(const char *n, char **instance); | int unit_name_to_instance(const char *n, char **instance); | |||
char* unit_name_to_prefix(const char *n); | char* unit_name_to_prefix(const char *n); | |||
char* unit_name_to_prefix_and_instance(const char *n); | char* unit_name_to_prefix_and_instance(const char *n); | |||
bool unit_name_is_valid(const char *n, bool template_ok) _pure_; | enum template_valid { | |||
TEMPLATE_INVALID, | ||||
TEMPLATE_VALID, | ||||
}; | ||||
bool unit_name_is_valid(const char *n, enum template_valid template_ok) _pu | ||||
re_; | ||||
bool unit_prefix_is_valid(const char *p) _pure_; | bool unit_prefix_is_valid(const char *p) _pure_; | |||
bool unit_instance_is_valid(const char *i) _pure_; | bool unit_instance_is_valid(const char *i) _pure_; | |||
UnitType unit_name_to_type(const char *n) _pure_; | UnitType unit_name_to_type(const char *n) _pure_; | |||
char *unit_name_change_suffix(const char *n, const char *suffix); | char *unit_name_change_suffix(const char *n, const char *suffix); | |||
char *unit_name_build(const char *prefix, const char *instance, const char *suffix); | char *unit_name_build(const char *prefix, const char *instance, const char *suffix); | |||
char *unit_name_escape(const char *f); | char *unit_name_escape(const char *f); | |||
skipping to change at line 100 | skipping to change at line 106 | |||
char *unit_name_template(const char *f); | char *unit_name_template(const char *f); | |||
char *unit_name_from_path(const char *path, const char *suffix); | char *unit_name_from_path(const char *path, const char *suffix); | |||
char *unit_name_from_path_instance(const char *prefix, const char *path, co nst char *suffix); | char *unit_name_from_path_instance(const char *prefix, const char *path, co nst char *suffix); | |||
char *unit_name_to_path(const char *name); | char *unit_name_to_path(const char *name); | |||
char *unit_dbus_path_from_name(const char *name); | char *unit_dbus_path_from_name(const char *name); | |||
int unit_name_from_dbus_path(const char *path, char **name); | int unit_name_from_dbus_path(const char *path, char **name); | |||
char *unit_name_mangle(const char *name); | enum unit_name_mangle { | |||
char *unit_name_mangle_with_suffix(const char *name, const char *suffix); | MANGLE_NOGLOB, | |||
MANGLE_GLOB, | ||||
}; | ||||
char *unit_name_mangle(const char *name, enum unit_name_mangle allow_globs) | ||||
; | ||||
char *unit_name_mangle_with_suffix(const char *name, enum unit_name_mangle | ||||
allow_globs, const char *suffix); | ||||
int build_subslice(const char *slice, const char*name, char **subslice); | int build_subslice(const char *slice, const char*name, char **subslice); | |||
End of changes. 6 change blocks. | ||||
5 lines changed or deleted | 19 lines changed or added | |||
unit.h | unit.h | |||
---|---|---|---|---|
skipping to change at line 35 | skipping to change at line 35 | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#include <unistd.h> | #include <unistd.h> | |||
typedef struct Unit Unit; | typedef struct Unit Unit; | |||
typedef struct UnitVTable UnitVTable; | typedef struct UnitVTable UnitVTable; | |||
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 "sd-event.h" | ||||
#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 "cgroup.h" | |||
#include "condition.h" | #include "condition.h" | |||
#include "install.h" | #include "install.h" | |||
#include "unit-name.h" | #include "unit-name.h" | |||
skipping to change at line 108 | skipping to change at line 109 | |||
UNIT_ON_FAILURE, | UNIT_ON_FAILURE, | |||
/* Triggers (i.e. a socket triggers a service) */ | /* Triggers (i.e. a socket triggers a service) */ | |||
UNIT_TRIGGERS, | UNIT_TRIGGERS, | |||
UNIT_TRIGGERED_BY, | UNIT_TRIGGERED_BY, | |||
/* Propagate reloads */ | /* Propagate reloads */ | |||
UNIT_PROPAGATES_RELOAD_TO, | UNIT_PROPAGATES_RELOAD_TO, | |||
UNIT_RELOAD_PROPAGATED_FROM, | UNIT_RELOAD_PROPAGATED_FROM, | |||
/* Joins namespace of */ | ||||
UNIT_JOINS_NAMESPACE_OF, | ||||
/* 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" | |||
skipping to change at line 176 | skipping to change at line 180 | |||
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 */ | |||
char *cgroup_path; | char *cgroup_path; | |||
CGroupControllerMask cgroup_mask; | CGroupControllerMask cgroup_realized_mask; | |||
CGroupControllerMask cgroup_subtree_mask; | ||||
CGroupControllerMask cgroup_members_mask; | ||||
UnitRef slice; | 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 */ | |||
skipping to change at line 201 | skipping to change at line 207 | |||
/* 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 */ | /* CGroup realize members queue */ | |||
LIST_FIELDS(Unit, cgroup_queue); | LIST_FIELDS(Unit, cgroup_queue); | |||
/* PIDs we keep an eye on. Note that a unit might have many | ||||
* more, but these are the ones we care enough about to | ||||
* process SIGCHLD for */ | ||||
Set *pids; | ||||
/* 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 242 | |||
/* Refuse manual starting, allow starting only indirectly via depen dency. */ | /* Refuse manual starting, allow starting only indirectly via depen dency. */ | |||
bool refuse_manual_start; | bool refuse_manual_start; | |||
/* Don't allow the user to stop this unit manually, allow stopping only indirectly via dependency. */ | /* Don't allow the user to stop this unit manually, allow stopping only indirectly via dependency. */ | |||
bool refuse_manual_stop; | bool refuse_manual_stop; | |||
/* Allow isolation requests */ | /* Allow isolation requests */ | |||
bool allow_isolate; | bool allow_isolate; | |||
/* Isolate OnFailure unit */ | /* How to start OnFailure units */ | |||
bool on_failure_isolate; | JobMode on_failure_job_mode; | |||
/* 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; | |||
skipping to change at line 259 | skipping to change at line 270 | |||
bool in_gc_queue:1; | bool in_gc_queue:1; | |||
bool in_cgroup_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; | |||
bool cgroup_realized:1; | bool cgroup_realized:1; | |||
bool cgroup_members_mask_valid:1; | ||||
bool cgroup_subtree_mask_valid:1; | ||||
}; | }; | |||
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 { | typedef enum UnitSetPropertiesMode { | |||
UNIT_CHECK = 0, | UNIT_CHECK = 0, | |||
UNIT_RUNTIME = 1, | UNIT_RUNTIME = 1, | |||
UNIT_PERSISTENT = 2, | UNIT_PERSISTENT = 2, | |||
} UnitSetPropertiesMode; | } UnitSetPropertiesMode; | |||
#include "service.h" | #include "service.h" | |||
#include "timer.h" | ||||
#include "socket.h" | #include "socket.h" | |||
#include "busname.h" | ||||
#include "target.h" | #include "target.h" | |||
#include "snapshot.h" | ||||
#include "device.h" | #include "device.h" | |||
#include "mount.h" | #include "mount.h" | |||
#include "automount.h" | #include "automount.h" | |||
#include "snapshot.h" | ||||
#include "swap.h" | #include "swap.h" | |||
#include "timer.h" | ||||
#include "path.h" | #include "path.h" | |||
#include "slice.h" | #include "slice.h" | |||
#include "scope.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; | |||
/* If greater than 0, the offset into the object where | /* If greater than 0, the offset into the object where | |||
* CGroupContext is found, if the unit type has that */ | * CGroupContext is found, if the unit type has that */ | |||
size_t cgroup_context_offset; | size_t cgroup_context_offset; | |||
/* If greater than 0, the offset into the object where | ||||
* KillContext is found, if the unit type has that */ | ||||
size_t kill_context_offset; | ||||
/* If greater than 0, the offset into the object where the | ||||
* pointer to ExecRuntime is found, if the unit type has | ||||
* that */ | ||||
size_t exec_runtime_offset; | ||||
/* The name of the configuration file section with the private sett ings of this unit*/ | /* The name of the configuration file section with the private sett ings of this unit*/ | |||
const char *private_section; | 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 | |||
skipping to change at line 330 | skipping to change at line 353 | |||
/* If a lot of units got created via enumerate(), this is | /* If a lot of units got created via enumerate(), this is | |||
* where to actually set the state and call unit_notify(). */ | * where to actually set the state and call unit_notify(). */ | |||
int (*coldplug)(Unit *u); | int (*coldplug)(Unit *u); | |||
void (*dump)(Unit *u, FILE *f, const char *prefix); | void (*dump)(Unit *u, FILE *f, const char *prefix); | |||
int (*start)(Unit *u); | int (*start)(Unit *u); | |||
int (*stop)(Unit *u); | int (*stop)(Unit *u); | |||
int (*reload)(Unit *u); | int (*reload)(Unit *u); | |||
int (*kill)(Unit *u, KillWho w, int signo, DBusError *error); | int (*kill)(Unit *u, KillWho w, int signo, sd_bus_error *error); | |||
bool (*can_reload)(Unit *u); | bool (*can_reload)(Unit *u); | |||
/* Write all data that cannot be restored from other sources | /* Write all data that cannot be restored from other sources | |||
* away using unit_serialize_item() */ | * away using unit_serialize_item() */ | |||
int (*serialize)(Unit *u, FILE *f, FDSet *fds); | int (*serialize)(Unit *u, FILE *f, FDSet *fds); | |||
/* Restore one item from the serialization */ | /* Restore one item from the serialization */ | |||
int (*deserialize_item)(Unit *u, const char *key, const char *data, FDSet *fds); | int (*deserialize_item)(Unit *u, const char *key, const char *data, FDSet *fds); | |||
skipping to change at line 362 | skipping to change at line 385 | |||
const char* (*sub_state_to_string)(Unit *u); | const char* (*sub_state_to_string)(Unit *u); | |||
/* Return true when there is reason to keep this entry around | /* Return true when there is reason to keep this entry around | |||
* even nothing references it and it isn't active in any | * even nothing references it and it isn't active in any | |||
* way */ | * way */ | |||
bool (*check_gc)(Unit *u); | bool (*check_gc)(Unit *u); | |||
/* Return true when this unit is suitable for snapshotting */ | /* Return true when this unit is suitable for snapshotting */ | |||
bool (*check_snapshot)(Unit *u); | bool (*check_snapshot)(Unit *u); | |||
void (*fd_event)(Unit *u, int fd, uint32_t events, Watch *w); | /* Invoked on every child that died */ | |||
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); | ||||
/* 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 (*notify_cgroup_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 */ | ||||
void (*bus_query_pid_done)(Unit *u, const char *name, pid_t pid); | ||||
/* Called for each message received on the bus */ | ||||
DBusHandlerResult (*bus_message_handler)(Unit *u, DBusConnection *c | ||||
, DBusMessage *message); | ||||
/* Called for each property that is being set */ | /* Called for each property that is being set */ | |||
int (*bus_set_property)(Unit *u, const char *name, DBusMessageIter *i, UnitSetPropertiesMode mode, DBusError *error); | int (*bus_set_property)(Unit *u, const char *name, sd_bus_message * message, UnitSetPropertiesMode mode, sd_bus_error *error); | |||
/* Called after at least one property got changed to apply the nece ssary change */ | /* Called after at least one property got changed to apply the nece ssary change */ | |||
int (*bus_commit_properties)(Unit *u); | 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); | |||
/* Called whenever CLOCK_REALTIME made a jump */ | /* Called whenever CLOCK_REALTIME made a jump */ | |||
void (*time_change)(Unit *u); | void (*time_change)(Unit *u); | |||
int (*get_timeout)(Unit *u, uint64_t *timeout); | ||||
/* This is called for each unit type and should be used to | /* This is called for each unit type and should be used to | |||
* enumerate existing devices and load them. However, | * enumerate existing devices and load them. However, | |||
* everything that is loaded here should still stay in | * everything that is loaded here should still stay in | |||
* inactive state. It is the job of the coldplug() call above | * inactive state. It is the job of the coldplug() call above | |||
* to put the units into the initial state. */ | * to put the units into the initial state. */ | |||
int (*enumerate)(Manager *m); | int (*enumerate)(Manager *m); | |||
/* Type specific cleanups. */ | /* Type specific cleanups. */ | |||
void (*shutdown)(Manager *m); | void (*shutdown)(Manager *m); | |||
/* When sending out PropertiesChanged signal, which properties | ||||
* shall be invalidated? This is a NUL separated list of | ||||
* strings, to minimize relocations a little. */ | ||||
const char *bus_invalidating_properties; | ||||
/* The interface name */ | /* The interface name */ | |||
const char *bus_interface; | const char *bus_interface; | |||
/* The bus vtable */ | ||||
const sd_bus_vtable *bus_vtable; | ||||
/* The strings to print in status messages */ | ||||
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; | |||
skipping to change at line 456 | skipping to change at line 473 | |||
return NULL; \ | return NULL; \ | |||
\ | \ | |||
return (MixedCase*) u; \ | return (MixedCase*) u; \ | |||
} | } | |||
/* For casting the various unit types into a unit */ | /* For casting the various unit types into a unit */ | |||
#define UNIT(u) (&(u)->meta) | #define UNIT(u) (&(u)->meta) | |||
#define UNIT_TRIGGER(u) ((Unit*) set_first((u)->dependencies[UNIT_TRIGGERS] )) | #define UNIT_TRIGGER(u) ((Unit*) set_first((u)->dependencies[UNIT_TRIGGERS] )) | |||
DEFINE_CAST(SOCKET, Socket); | ||||
DEFINE_CAST(TIMER, Timer); | ||||
DEFINE_CAST(SERVICE, Service); | DEFINE_CAST(SERVICE, Service); | |||
DEFINE_CAST(SOCKET, Socket); | ||||
DEFINE_CAST(BUSNAME, BusName); | ||||
DEFINE_CAST(TARGET, Target); | DEFINE_CAST(TARGET, Target); | |||
DEFINE_CAST(SNAPSHOT, Snapshot); | ||||
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(SWAP, Swap); | DEFINE_CAST(SWAP, Swap); | |||
DEFINE_CAST(TIMER, Timer); | ||||
DEFINE_CAST(PATH, Path); | DEFINE_CAST(PATH, Path); | |||
DEFINE_CAST(SLICE, Slice); | DEFINE_CAST(SLICE, Slice); | |||
DEFINE_CAST(SCOPE, Scope); | 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); | |||
skipping to change at line 504 | skipping to change at line 522 | |||
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); | int unit_add_default_slice(Unit *u, CGroupContext *c); | |||
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); | |||
bool unit_can_reload(Unit *u) _pure_; | bool unit_can_reload(Unit *u) _pure_; | |||
bool unit_can_start(Unit *u) _pure_; | bool unit_can_start(Unit *u) _pure_; | |||
bool unit_can_isolate(Unit *u) _pure_; | bool unit_can_isolate(Unit *u) _pure_; | |||
int unit_start(Unit *u); | int unit_start(Unit *u); | |||
int unit_stop(Unit *u); | int unit_stop(Unit *u); | |||
int unit_reload(Unit *u); | int unit_reload(Unit *u); | |||
int unit_kill(Unit *u, KillWho w, int signo, DBusError *error); | int unit_kill(Unit *u, KillWho w, int signo, sd_bus_error *error); | |||
int unit_kill_common(Unit *u, KillWho who, int signo, pid_t main_pid, pid_t | int unit_kill_common(Unit *u, KillWho who, int signo, pid_t main_pid, pid_t | |||
control_pid, DBusError *error); | control_pid, sd_bus_error *error); | |||
void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool relo ad_success); | void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool relo ad_success); | |||
int unit_watch_fd(Unit *u, int fd, uint32_t events, Watch *w); | ||||
void unit_unwatch_fd(Unit *u, Watch *w); | ||||
int unit_watch_pid(Unit *u, pid_t pid); | int unit_watch_pid(Unit *u, pid_t pid); | |||
void unit_unwatch_pid(Unit *u, pid_t pid); | void unit_unwatch_pid(Unit *u, pid_t pid); | |||
int unit_watch_all_pids(Unit *u); | ||||
void unit_unwatch_all_pids(Unit *u); | ||||
int unit_watch_timer(Unit *u, clockid_t, bool relative, usec_t usec, Watch | void unit_tidy_watch_pids(Unit *u, pid_t except1, pid_t except2); | |||
*w); | ||||
void unit_unwatch_timer(Unit *u, Watch *w); | ||||
int unit_watch_bus_name(Unit *u, const char *name); | int unit_watch_bus_name(Unit *u, const char *name); | |||
void unit_unwatch_bus_name(Unit *u, const char *name); | void unit_unwatch_bus_name(Unit *u, const char *name); | |||
bool unit_job_is_applicable(Unit *u, JobType j); | bool unit_job_is_applicable(Unit *u, JobType j); | |||
int set_unit_path(const char *p); | int set_unit_path(const char *p); | |||
char *unit_dbus_path(Unit *u); | char *unit_dbus_path(Unit *u); | |||
int unit_load_related_unit(Unit *u, const char *type, Unit **_found); | int unit_load_related_unit(Unit *u, const char *type, Unit **_found); | |||
int unit_get_related_unit(Unit *u, const char *type, Unit **_found); | ||||
bool unit_can_serialize(Unit *u) _pure_; | bool unit_can_serialize(Unit *u) _pure_; | |||
int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs); | int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs); | |||
void unit_serialize_item_format(Unit *u, FILE *f, const char *key, const ch ar *value, ...) _printf_attr_(4,5); | void unit_serialize_item_format(Unit *u, FILE *f, const char *key, const ch ar *value, ...) _printf_(4,5); | |||
void unit_serialize_item(Unit *u, FILE *f, const char *key, const char *val ue); | void unit_serialize_item(Unit *u, FILE *f, const char *key, const char *val ue); | |||
int unit_deserialize(Unit *u, FILE *f, FDSet *fds); | int unit_deserialize(Unit *u, FILE *f, FDSet *fds); | |||
int unit_add_node_link(Unit *u, const char *what, bool wants); | int unit_add_node_link(Unit *u, const char *what, bool wants); | |||
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_(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); | |||
int unit_following_set(Unit *u, Set **s); | ||||
const char *unit_slice_name(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); | ||||
void unit_start_on_failure(Unit *u); | void unit_start_on_failure(Unit *u); | |||
void unit_trigger_notify(Unit *u); | void unit_trigger_notify(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) | #define UNIT_ISSET(ref) (!!(ref).unit) | |||
int unit_add_mount_links(Unit *u); | int unit_patch_contexts(Unit *u); | |||
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_; | |||
KillContext *unit_get_kill_context(Unit *u) _pure_; | ||||
CGroupContext *unit_get_cgroup_context(Unit *u) _pure_; | CGroupContext *unit_get_cgroup_context(Unit *u) _pure_; | |||
ExecRuntime *unit_get_exec_runtime(Unit *u) _pure_; | ||||
int unit_setup_exec_runtime(Unit *u); | ||||
int unit_write_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *nam e, const char *data); | int unit_write_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *nam e, const char *data); | |||
int unit_write_drop_in_format(Unit *u, UnitSetPropertiesMode mode, const ch ar *name, const char *format, ...) _printf_attr_(4,5); | int unit_write_drop_in_format(Unit *u, UnitSetPropertiesMode mode, const ch ar *name, const char *format, ...) _printf_(4,5); | |||
int unit_write_drop_in_private(Unit *u, UnitSetPropertiesMode mode, const c har *name, const char *data); | int unit_write_drop_in_private(Unit *u, UnitSetPropertiesMode mode, const c har *name, const char *data); | |||
int unit_write_drop_in_private_format(Unit *u, UnitSetPropertiesMode mode, const char *name, const char *format, ...) _printf_attr_(4,5); | int unit_write_drop_in_private_format(Unit *u, UnitSetPropertiesMode mode, const char *name, const char *format, ...) _printf_(4,5); | |||
int unit_remove_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *na me); | 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); | int unit_make_transient(Unit *u); | |||
int unit_require_mounts_for(Unit *u, const char *path); | int unit_require_mounts_for(Unit *u, const char *path); | |||
const char *unit_active_state_to_string(UnitActiveState i) _const_; | const char *unit_active_state_to_string(UnitActiveState i) _const_; | |||
End of changes. 41 change blocks. | ||||
46 lines changed or deleted | 59 lines changed or added | |||
utf8.h | utf8.h | |||
---|---|---|---|---|
skipping to change at line 28 | skipping to change at line 28 | |||
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/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include "macro.h" | #include "macro.h" | |||
#define UTF8_REPLACEMENT_CHARACTER "\xef\xbf\xbd" | ||||
const char *utf8_is_valid(const char *s) _pure_; | const char *utf8_is_valid(const char *s) _pure_; | |||
char *ascii_is_valid(const char *s) _pure_; | char *ascii_is_valid(const char *s) _pure_; | |||
char *utf8_escape_invalid(const char *s); | ||||
bool utf8_is_printable(const char* str, size_t length) _pure_; | bool utf8_is_printable_newline(const char* str, size_t length, bool newline | |||
) _pure_; | ||||
char *ascii_filter(const char *s); | _pure_ static inline bool utf8_is_printable(const char* str, size_t length) | |||
{ | ||||
return utf8_is_printable_newline(str, length, true); | ||||
} | ||||
char *utf16_to_utf8(const void *s, size_t length); | char *utf16_to_utf8(const void *s, size_t length); | |||
int utf8_encoded_valid_unichar(const char *str); | int utf8_encoded_valid_unichar(const char *str); | |||
int utf8_encoded_to_unichar(const char *str); | ||||
End of changes. 4 change blocks. | ||||
3 lines changed or deleted | 9 lines changed or added | |||
util.h | util.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/>. | |||
***/ | ***/ | |||
#include <alloca.h> | #include <alloca.h> | |||
#include <fcntl.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <time.h> | #include <time.h> | |||
#include <sys/time.h> | #include <sys/time.h> | |||
#include <stdarg.h> | #include <stdarg.h> | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#include <signal.h> | #include <signal.h> | |||
#include <sched.h> | #include <sched.h> | |||
#include <limits.h> | #include <limits.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <sys/stat.h> | #include <sys/stat.h> | |||
#include <dirent.h> | #include <dirent.h> | |||
#include <sys/resource.h> | #include <sys/resource.h> | |||
#include <stddef.h> | #include <stddef.h> | |||
#include <unistd.h> | #include <unistd.h> | |||
#include <locale.h> | #include <locale.h> | |||
#include <mntent.h> | ||||
#include <sys/socket.h> | ||||
#if SIZEOF_PID_T == 4 | ||||
# define PID_FMT "%" PRIu32 | ||||
#elif SIZEOF_PID_T == 2 | ||||
# define PID_FMT "%" PRIu16 | ||||
#else | ||||
# error Unknown pid_t size | ||||
#endif | ||||
#if SIZEOF_UID_T == 4 | ||||
# define UID_FMT "%" PRIu32 | ||||
#elif SIZEOF_UID_T == 2 | ||||
# define UID_FMT "%" PRIu16 | ||||
#else | ||||
# error Unknown uid_t size | ||||
#endif | ||||
#if SIZEOF_GID_T == 4 | ||||
# define GID_FMT "%" PRIu32 | ||||
#elif SIZEOF_GID_T == 2 | ||||
# define GID_FMT "%" PRIu16 | ||||
#else | ||||
# error Unknown gid_t size | ||||
#endif | ||||
#if SIZEOF_TIME_T == 8 | ||||
# define PRI_TIME PRIu64 | ||||
#elif SIZEOF_GID_T == 4 | ||||
# define PRI_TIME PRIu32 | ||||
#else | ||||
# error Unknown time_t size | ||||
#endif | ||||
#if SIZEOF_RLIM_T == 8 | ||||
# define RLIM_FMT "%" PRIu64 | ||||
#elif SIZEOF_RLIM_T == 4 | ||||
# define RLIM_FMT "%" PRIu32 | ||||
#else | ||||
# error Unknown rlim_t size | ||||
#endif | ||||
#include "macro.h" | #include "macro.h" | |||
#include "missing.h" | ||||
#include "time-util.h" | #include "time-util.h" | |||
union dirent_storage { | ||||
struct dirent de; | ||||
uint8_t storage[offsetof(struct dirent, d_name) + | ||||
((NAME_MAX + 1 + sizeof(long)) & ~(sizeof(long) - 1 | ||||
))]; | ||||
}; | ||||
/* What is interpreted as whitespace? */ | /* What is interpreted as whitespace? */ | |||
#define WHITESPACE " \t\n\r" | #define WHITESPACE " \t\n\r" | |||
#define NEWLINE "\n\r" | #define NEWLINE "\n\r" | |||
#define QUOTES "\"\'" | #define QUOTES "\"\'" | |||
#define COMMENTS "#;" | #define COMMENTS "#;" | |||
#define GLOB_CHARS "*?[" | ||||
#define FORMAT_BYTES_MAX 8 | #define FORMAT_BYTES_MAX 8 | |||
#define ANSI_HIGHLIGHT_ON "\x1B[1;39m" | #define ANSI_HIGHLIGHT_ON "\x1B[1;39m" | |||
#define ANSI_RED_ON "\x1B[31m" | #define ANSI_RED_ON "\x1B[31m" | |||
#define ANSI_HIGHLIGHT_RED_ON "\x1B[1;31m" | #define ANSI_HIGHLIGHT_RED_ON "\x1B[1;31m" | |||
#define ANSI_GREEN_ON "\x1B[32m" | #define ANSI_GREEN_ON "\x1B[32m" | |||
#define ANSI_HIGHLIGHT_GREEN_ON "\x1B[1;32m" | #define ANSI_HIGHLIGHT_GREEN_ON "\x1B[1;32m" | |||
#define ANSI_HIGHLIGHT_YELLOW_ON "\x1B[1;33m" | #define ANSI_HIGHLIGHT_YELLOW_ON "\x1B[1;33m" | |||
#define ANSI_HIGHLIGHT_BLUE_ON "\x1B[1;34m" | ||||
#define ANSI_HIGHLIGHT_OFF "\x1B[0m" | #define ANSI_HIGHLIGHT_OFF "\x1B[0m" | |||
#define ANSI_ERASE_TO_END_OF_LINE "\x1B[K" | #define ANSI_ERASE_TO_END_OF_LINE "\x1B[K" | |||
size_t page_size(void); | size_t page_size(void); | |||
#define PAGE_ALIGN(l) ALIGN_TO((l), page_size()) | #define PAGE_ALIGN(l) ALIGN_TO((l), page_size()) | |||
#define streq(a,b) (strcmp((a),(b)) == 0) | #define streq(a,b) (strcmp((a),(b)) == 0) | |||
#define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) | #define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) | |||
#define strcaseeq(a,b) (strcasecmp((a),(b)) == 0) | #define strcaseeq(a,b) (strcasecmp((a),(b)) == 0) | |||
#define strncaseeq(a, b, n) (strncasecmp((a), (b), (n)) == 0) | #define strncaseeq(a, b, n) (strncasecmp((a), (b), (n)) == 0) | |||
skipping to change at line 93 | skipping to change at line 133 | |||
#define newa(t, n) ((t*) alloca(sizeof(t)*(n))) | #define newa(t, n) ((t*) alloca(sizeof(t)*(n))) | |||
#define newdup(t, p, n) ((t*) memdup_multiply(p, sizeof(t), (n))) | #define newdup(t, p, n) ((t*) memdup_multiply(p, sizeof(t), (n))) | |||
#define malloc0(n) (calloc((n), 1)) | #define malloc0(n) (calloc((n), 1)) | |||
static inline const char* yes_no(bool b) { | static inline const char* yes_no(bool b) { | |||
return b ? "yes" : "no"; | return b ? "yes" : "no"; | |||
} | } | |||
static inline const char* true_false(bool b) { | ||||
return b ? "true" : "false"; | ||||
} | ||||
static inline const char* strempty(const char *s) { | static inline const char* strempty(const char *s) { | |||
return s ? s : ""; | return s ? s : ""; | |||
} | } | |||
static inline const char* strnull(const char *s) { | static inline const char* strnull(const char *s) { | |||
return s ? s : "(null)"; | return s ? s : "(null)"; | |||
} | } | |||
static inline const char *strna(const char *s) { | static inline const char *strna(const char *s) { | |||
return s ? s : "n/a"; | return s ? s : "n/a"; | |||
skipping to change at line 126 | skipping to change at line 170 | |||
if (strncasecmp(s, prefix, strlen(prefix)) == 0) | if (strncasecmp(s, prefix, strlen(prefix)) == 0) | |||
return s + strlen(prefix); | return s + strlen(prefix); | |||
return NULL; | return NULL; | |||
} | } | |||
char *endswith(const char *s, const char *postfix) _pure_; | char *endswith(const char *s, const char *postfix) _pure_; | |||
bool first_word(const char *s, const char *word) _pure_; | bool first_word(const char *s, const char *word) _pure_; | |||
int close_nointr(int fd); | int close_nointr(int fd); | |||
void close_nointr_nofail(int fd); | int safe_close(int fd); | |||
void safe_close_pair(int p[]); | ||||
void close_many(const int fds[], unsigned n_fd); | void close_many(const int fds[], unsigned n_fd); | |||
int parse_size(const char *t, off_t base, off_t *size); | ||||
int parse_boolean(const char *v) _pure_; | int parse_boolean(const char *v) _pure_; | |||
int parse_bytes(const char *t, off_t *bytes); | ||||
int parse_pid(const char *s, pid_t* ret_pid); | int parse_pid(const char *s, pid_t* ret_pid); | |||
int parse_uid(const char *s, uid_t* ret_uid); | int parse_uid(const char *s, uid_t* ret_uid); | |||
#define parse_gid(s, ret_uid) parse_uid(s, ret_uid) | #define parse_gid(s, ret_uid) parse_uid(s, ret_uid) | |||
int safe_atou(const char *s, unsigned *ret_u); | int safe_atou(const char *s, unsigned *ret_u); | |||
int safe_atoi(const char *s, int *ret_i); | int safe_atoi(const char *s, int *ret_i); | |||
int safe_atollu(const char *s, unsigned long long *ret_u); | int safe_atollu(const char *s, unsigned long long *ret_u); | |||
int safe_atolli(const char *s, long long int *ret_i); | int safe_atolli(const char *s, long long int *ret_i); | |||
skipping to change at line 183 | skipping to change at line 230 | |||
static inline int safe_atou64(const char *s, uint64_t *ret_u) { | static inline int safe_atou64(const char *s, uint64_t *ret_u) { | |||
assert_cc(sizeof(uint64_t) == sizeof(unsigned long long)); | assert_cc(sizeof(uint64_t) == sizeof(unsigned long long)); | |||
return safe_atollu(s, (unsigned long long*) ret_u); | return safe_atollu(s, (unsigned long long*) ret_u); | |||
} | } | |||
static inline int safe_atoi64(const char *s, int64_t *ret_i) { | static inline int safe_atoi64(const char *s, int64_t *ret_i) { | |||
assert_cc(sizeof(int64_t) == sizeof(long long int)); | assert_cc(sizeof(int64_t) == sizeof(long long int)); | |||
return safe_atolli(s, (long long int*) ret_i); | return safe_atolli(s, (long long int*) ret_i); | |||
} | } | |||
char *split(const char *c, size_t *l, const char *separator, char **state); | char *split(const char *c, size_t *l, const char *separator, bool quoted, c | |||
char *split_quoted(const char *c, size_t *l, char **state); | har **state); | |||
#define FOREACH_WORD(word, length, s, state) \ | #define FOREACH_WORD(word, length, s, state) \ | |||
for ((state) = NULL, (word) = split((s), &(length), WHITESPACE, &(s tate)); (word); (word) = split((s), &(length), WHITESPACE, &(state))) | _FOREACH_WORD(word, length, s, WHITESPACE, false, state) | |||
#define FOREACH_WORD_SEPARATOR(word, length, s, separator, state) \ | #define FOREACH_WORD_SEPARATOR(word, length, s, separator, state) \ | |||
for ((state) = NULL, (word) = split((s), &(length), (separator), &( state)); (word); (word) = split((s), &(length), (separator), &(state))) | _FOREACH_WORD(word, length, s, separator, false, state) | |||
#define FOREACH_WORD_QUOTED(word, length, s, state) \ | #define FOREACH_WORD_QUOTED(word, length, s, state) \ | |||
for ((state) = NULL, (word) = split_quoted((s), &(length), &(state) | _FOREACH_WORD(word, length, s, WHITESPACE, true, state) | |||
); (word); (word) = split_quoted((s), &(length), &(state))) | ||||
#define FOREACH_WORD_SEPARATOR_QUOTED(word, length, s, separator, state) | ||||
\ | ||||
_FOREACH_WORD(word, length, s, separator, true, state) | ||||
#define _FOREACH_WORD(word, length, s, separator, quoted, state) \ | ||||
for ((state) = NULL, (word) = split((s), &(length), (separator), (q | ||||
uoted), &(state)); (word); (word) = split((s), &(length), (separator), (quo | ||||
ted), &(state))) | ||||
pid_t get_parent_of_pid(pid_t pid, pid_t *ppid); | pid_t get_parent_of_pid(pid_t pid, pid_t *ppid); | |||
int get_starttime_of_pid(pid_t pid, unsigned long long *st); | int get_starttime_of_pid(pid_t pid, unsigned long long *st); | |||
char *strappend(const char *s, const char *suffix); | char *strappend(const char *s, const char *suffix); | |||
char *strnappend(const char *s, const char *suffix, size_t length); | char *strnappend(const char *s, const char *suffix, size_t length); | |||
char *replace_env(const char *format, char **env); | char *replace_env(const char *format, char **env); | |||
char **replace_env_argv(char **argv, char **env); | char **replace_env_argv(char **argv, char **env); | |||
int readlinkat_malloc(int fd, const char *p, char **ret); | ||||
int readlink_malloc(const char *p, char **r); | int readlink_malloc(const char *p, char **r); | |||
int readlink_and_make_absolute(const char *p, char **r); | int readlink_and_make_absolute(const char *p, char **r); | |||
int readlink_and_canonicalize(const char *p, char **r); | int readlink_and_canonicalize(const char *p, char **r); | |||
int reset_all_signal_handlers(void); | int reset_all_signal_handlers(void); | |||
char *strstrip(char *s); | char *strstrip(char *s); | |||
char *delete_chars(char *s, const char *bad); | char *delete_chars(char *s, const char *bad); | |||
char *truncate_nl(char *s); | char *truncate_nl(char *s); | |||
char *file_in_same_dir(const char *path, const char *filename); | char *file_in_same_dir(const char *path, const char *filename); | |||
int rmdir_parents(const char *path, const char *stop); | int rmdir_parents(const char *path, const char *stop); | |||
int get_process_state(pid_t pid); | ||||
int get_process_comm(pid_t pid, char **name); | int get_process_comm(pid_t pid, char **name); | |||
int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, c har **line); | int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, c har **line); | |||
int get_process_exe(pid_t pid, char **name); | int get_process_exe(pid_t pid, char **name); | |||
int get_process_uid(pid_t pid, uid_t *uid); | int get_process_uid(pid_t pid, uid_t *uid); | |||
int get_process_gid(pid_t pid, gid_t *gid); | int get_process_gid(pid_t pid, gid_t *gid); | |||
int get_process_capeff(pid_t pid, char **capeff); | int get_process_capeff(pid_t pid, char **capeff); | |||
char hexchar(int x) _const_; | char hexchar(int x) _const_; | |||
int unhexchar(char c) _const_; | int unhexchar(char c) _const_; | |||
char octchar(int x) _const_; | char octchar(int x) _const_; | |||
skipping to change at line 239 | skipping to change at line 293 | |||
char decchar(int x) _const_; | char decchar(int x) _const_; | |||
int undecchar(char c) _const_; | int undecchar(char c) _const_; | |||
char *cescape(const char *s); | char *cescape(const char *s); | |||
char *cunescape(const char *s); | char *cunescape(const char *s); | |||
char *cunescape_length(const char *s, size_t length); | char *cunescape_length(const char *s, size_t length); | |||
char *cunescape_length_with_prefix(const char *s, size_t length, const char *prefix); | char *cunescape_length_with_prefix(const char *s, size_t length, const char *prefix); | |||
char *xescape(const char *s, const char *bad); | char *xescape(const char *s, const char *bad); | |||
char *bus_path_escape(const char *s); | ||||
char *bus_path_unescape(const char *s); | ||||
char *ascii_strlower(char *path); | char *ascii_strlower(char *path); | |||
bool dirent_is_file(const struct dirent *de) _pure_; | bool dirent_is_file(const struct dirent *de) _pure_; | |||
bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix ) _pure_; | bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix ) _pure_; | |||
bool ignore_file(const char *filename) _pure_; | bool ignore_file(const char *filename) _pure_; | |||
bool chars_intersect(const char *a, const char *b) _pure_; | bool chars_intersect(const char *a, const char *b) _pure_; | |||
int make_stdio(int fd); | int make_stdio(int fd); | |||
int make_null_stdio(void); | int make_null_stdio(void); | |||
int make_console_stdio(void); | int make_console_stdio(void); | |||
unsigned long long random_ull(void); | int dev_urandom(void *p, size_t n); | |||
unsigned random_u(void); | void random_bytes(void *p, size_t n); | |||
static inline uint64_t random_u64(void) { | ||||
uint64_t u; | ||||
random_bytes(&u, sizeof(u)); | ||||
return u; | ||||
} | ||||
static inline uint32_t random_u32(void) { | ||||
uint32_t u; | ||||
random_bytes(&u, sizeof(u)); | ||||
return u; | ||||
} | ||||
/* For basic lookup tables with strictly enumerated entries */ | /* For basic lookup tables with strictly enumerated entries */ | |||
#define __DEFINE_STRING_TABLE_LOOKUP(name,type,scope) \ | #define __DEFINE_STRING_TABLE_LOOKUP(name,type,scope) \ | |||
scope const char *name##_to_string(type i) { \ | scope const char *name##_to_string(type i) { \ | |||
if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \ | if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \ | |||
return NULL; \ | return NULL; \ | |||
return name##_table[i]; \ | return name##_table[i]; \ | |||
} \ | } \ | |||
scope type name##_from_string(const char *s) { \ | scope type name##_from_string(const char *s) { \ | |||
type i; \ | type i; \ | |||
assert(s); \ | if (!s) \ | |||
return (type) -1; \ | ||||
for (i = 0; i < (type)ELEMENTSOF(name##_table); i++) \ | for (i = 0; i < (type)ELEMENTSOF(name##_table); i++) \ | |||
if (name##_table[i] && \ | if (name##_table[i] && \ | |||
streq(name##_table[i], s)) \ | streq(name##_table[i], s)) \ | |||
return i; \ | return i; \ | |||
return (type) -1; \ | return (type) -1; \ | |||
} \ | } \ | |||
struct __useless_struct_to_allow_trailing_semicolon__ | struct __useless_struct_to_allow_trailing_semicolon__ | |||
#define DEFINE_STRING_TABLE_LOOKUP(name,type) __DEFINE_STRING_TABLE_LOOKUP( name,type,) | #define DEFINE_STRING_TABLE_LOOKUP(name,type) __DEFINE_STRING_TABLE_LOOKUP( name,type,) | |||
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP(name,type) __DEFINE_STRING_TABLE _LOOKUP(name,type,static) | #define DEFINE_PRIVATE_STRING_TABLE_LOOKUP(name,type) __DEFINE_STRING_TABLE _LOOKUP(name,type,static) | |||
skipping to change at line 322 | skipping to change at line 386 | |||
int fd_nonblock(int fd, bool nonblock); | int fd_nonblock(int fd, bool nonblock); | |||
int fd_cloexec(int fd, bool cloexec); | int fd_cloexec(int fd, bool cloexec); | |||
int close_all_fds(const int except[], unsigned n_except); | int close_all_fds(const int except[], unsigned n_except); | |||
bool fstype_is_network(const char *fstype); | bool fstype_is_network(const char *fstype); | |||
int chvt(int vt); | int chvt(int vt); | |||
int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl); | int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl); | |||
int ask(char *ret, const char *replies, const char *text, ...) _printf_attr _(3, 4); | int ask(char *ret, const char *replies, const char *text, ...) _printf_(3, 4); | |||
int reset_terminal_fd(int fd, bool switch_to_text); | int reset_terminal_fd(int fd, bool switch_to_text); | |||
int reset_terminal(const char *name); | int reset_terminal(const char *name); | |||
int open_terminal(const char *name, int mode); | int open_terminal(const char *name, int mode); | |||
int acquire_terminal(const char *name, bool fail, bool force, bool ignore_t iocstty_eperm, usec_t timeout); | int acquire_terminal(const char *name, bool fail, bool force, bool ignore_t iocstty_eperm, usec_t timeout); | |||
int release_terminal(void); | int release_terminal(void); | |||
int flush_fd(int fd); | int flush_fd(int fd); | |||
int ignore_signals(int sig, ...); | int ignore_signals(int sig, ...); | |||
int default_signals(int sig, ...); | int default_signals(int sig, ...); | |||
int sigaction_many(const struct sigaction *sa, ...); | int sigaction_many(const struct sigaction *sa, ...); | |||
int close_pipe(int p[]); | ||||
int fopen_temporary(const char *path, FILE **_f, char **_temp_path); | int fopen_temporary(const char *path, FILE **_f, char **_temp_path); | |||
ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll); | ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll); | |||
ssize_t loop_write(int fd, const void *buf, size_t nbytes, bool do_poll); | ssize_t loop_write(int fd, const void *buf, size_t nbytes, bool do_poll); | |||
bool is_device_path(const char *path); | bool is_device_path(const char *path); | |||
int dir_is_empty(const char *path); | int dir_is_empty(const char *path); | |||
char* dirname_malloc(const char *path); | char* dirname_malloc(const char *path); | |||
void rename_process(const char name[8]); | void rename_process(const char name[8]); | |||
void sigset_add_many(sigset_t *ss, ...); | void sigset_add_many(sigset_t *ss, ...); | |||
int sigprocmask_many(int how, ...); | ||||
bool hostname_is_set(void); | bool hostname_is_set(void); | |||
char* gethostname_malloc(void); | char* gethostname_malloc(void); | |||
char* getlogname_malloc(void); | char* getlogname_malloc(void); | |||
char* getusername_malloc(void); | char* getusername_malloc(void); | |||
int getttyname_malloc(int fd, char **r); | int getttyname_malloc(int fd, char **r); | |||
int getttyname_harder(int fd, char **r); | int getttyname_harder(int fd, char **r); | |||
skipping to change at line 376 | skipping to change at line 440 | |||
int rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root_dev); | int rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root_dev); | |||
int rm_rf_children_dangerous(int fd, bool only_dirs, bool honour_sticky, st ruct stat *root_dev); | int rm_rf_children_dangerous(int fd, bool only_dirs, bool honour_sticky, st ruct stat *root_dev); | |||
int rm_rf(const char *path, bool only_dirs, bool delete_root, bool honour_s ticky); | int rm_rf(const char *path, bool only_dirs, bool delete_root, bool honour_s ticky); | |||
int rm_rf_dangerous(const char *path, bool only_dirs, bool delete_root, boo l honour_sticky); | int rm_rf_dangerous(const char *path, bool only_dirs, bool delete_root, boo l honour_sticky); | |||
int pipe_eof(int fd); | int pipe_eof(int fd); | |||
cpu_set_t* cpu_set_malloc(unsigned *ncpus); | cpu_set_t* cpu_set_malloc(unsigned *ncpus); | |||
int status_vprintf(const char *status, bool ellipse, bool ephemeral, const | int status_vprintf(const char *status, bool ellipse, bool ephemeral, const | |||
char *format, va_list ap) _printf_attr_(4,0); | char *format, va_list ap) _printf_(4,0); | |||
int status_printf(const char *status, bool ellipse, bool ephemeral, const c | int status_printf(const char *status, bool ellipse, bool ephemeral, const c | |||
har *format, ...) _printf_attr_(4,5); | har *format, ...) _printf_(4,5); | |||
int status_welcome(void); | ||||
int fd_columns(int fd); | int fd_columns(int fd); | |||
unsigned columns(void); | unsigned columns(void); | |||
int fd_lines(int fd); | int fd_lines(int fd); | |||
unsigned lines(void); | unsigned lines(void); | |||
void columns_lines_cache_reset(int _unused_ signum); | void columns_lines_cache_reset(int _unused_ signum); | |||
bool on_tty(void); | bool on_tty(void); | |||
static inline const char *ansi_highlight(void) { | static inline const char *ansi_highlight(void) { | |||
skipping to change at line 400 | skipping to change at line 463 | |||
} | } | |||
static inline const char *ansi_highlight_red(void) { | static inline const char *ansi_highlight_red(void) { | |||
return on_tty() ? ANSI_HIGHLIGHT_RED_ON : ""; | return on_tty() ? ANSI_HIGHLIGHT_RED_ON : ""; | |||
} | } | |||
static inline const char *ansi_highlight_green(void) { | static inline const char *ansi_highlight_green(void) { | |||
return on_tty() ? ANSI_HIGHLIGHT_GREEN_ON : ""; | return on_tty() ? ANSI_HIGHLIGHT_GREEN_ON : ""; | |||
} | } | |||
static inline const char *ansi_highlight_yellow(void) { | ||||
return on_tty() ? ANSI_HIGHLIGHT_YELLOW_ON : ""; | ||||
} | ||||
static inline const char *ansi_highlight_blue(void) { | ||||
return on_tty() ? ANSI_HIGHLIGHT_BLUE_ON : ""; | ||||
} | ||||
static inline const char *ansi_highlight_off(void) { | static inline const char *ansi_highlight_off(void) { | |||
return on_tty() ? ANSI_HIGHLIGHT_OFF : ""; | return on_tty() ? ANSI_HIGHLIGHT_OFF : ""; | |||
} | } | |||
int files_same(const char *filea, const char *fileb); | ||||
int running_in_chroot(void); | int running_in_chroot(void); | |||
char *ellipsize(const char *s, size_t length, unsigned percent); | char *ellipsize(const char *s, size_t length, unsigned percent); | |||
/* bytes columns */ | ||||
char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, un signed percent); | char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, un signed percent); | |||
int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid _t gid, mode_t mode); | ||||
int touch(const char *path); | int touch(const char *path); | |||
char *unquote(const char *s, const char *quotes); | char *unquote(const char *s, const char *quotes); | |||
char *normalize_env_assignment(const char *s); | char *normalize_env_assignment(const char *s); | |||
int wait_for_terminate(pid_t pid, siginfo_t *status); | int wait_for_terminate(pid_t pid, siginfo_t *status); | |||
int wait_for_terminate_and_warn(const char *name, pid_t pid); | int wait_for_terminate_and_warn(const char *name, pid_t pid); | |||
_noreturn_ void freeze(void); | noreturn void freeze(void); | |||
bool null_or_empty(struct stat *st) _pure_; | bool null_or_empty(struct stat *st) _pure_; | |||
int null_or_empty_path(const char *fn); | int null_or_empty_path(const char *fn); | |||
DIR *xopendirat(int dirfd, const char *name, int flags); | DIR *xopendirat(int dirfd, const char *name, int flags); | |||
char *fstab_node_to_udev_node(const char *p); | char *fstab_node_to_udev_node(const char *p); | |||
char *resolve_dev_console(char **active); | char *resolve_dev_console(char **active); | |||
bool tty_is_vc(const char *tty); | bool tty_is_vc(const char *tty); | |||
bool tty_is_vc_resolve(const char *tty); | bool tty_is_vc_resolve(const char *tty); | |||
bool tty_is_console(const char *tty) _pure_; | bool tty_is_console(const char *tty) _pure_; | |||
int vtnr_from_tty(const char *tty); | int vtnr_from_tty(const char *tty); | |||
const char *default_term_for_tty(const char *tty); | const char *default_term_for_tty(const char *tty); | |||
void execute_directory(const char *directory, DIR *_d, char *argv[]); | void execute_directory(const char *directory, DIR *_d, usec_t timeout, char *argv[]); | |||
int kill_and_sigcont(pid_t pid, int sig); | int kill_and_sigcont(pid_t pid, int sig); | |||
bool nulstr_contains(const char*nulstr, const char *needle); | bool nulstr_contains(const char*nulstr, const char *needle); | |||
bool plymouth_running(void); | bool plymouth_running(void); | |||
bool hostname_is_valid(const char *s) _pure_; | bool hostname_is_valid(const char *s) _pure_; | |||
char* hostname_cleanup(char *s, bool lowercase); | char* hostname_cleanup(char *s, bool lowercase); | |||
bool machine_name_is_valid(const char *s) _pure_; | ||||
char* strshorten(char *s, size_t l); | char* strshorten(char *s, size_t l); | |||
int terminal_vhangup_fd(int fd); | int terminal_vhangup_fd(int fd); | |||
int terminal_vhangup(const char *name); | int terminal_vhangup(const char *name); | |||
int vt_disallocate(const char *name); | int vt_disallocate(const char *name); | |||
int copy_file(const char *from, const char *to); | ||||
int symlink_atomic(const char *from, const char *to); | int symlink_atomic(const char *from, const char *to); | |||
int mknod_atomic(const char *path, mode_t mode, dev_t dev); | ||||
int mkfifo_atomic(const char *path, mode_t mode); | ||||
int fchmod_umask(int fd, mode_t mode); | int fchmod_umask(int fd, mode_t mode); | |||
bool display_is_local(const char *display) _pure_; | bool display_is_local(const char *display) _pure_; | |||
int socket_from_display(const char *display, char **path); | int socket_from_display(const char *display, char **path); | |||
int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const cha r **home, const char **shell); | int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const cha r **home, const char **shell); | |||
int get_group_creds(const char **groupname, gid_t *gid); | int get_group_creds(const char **groupname, gid_t *gid); | |||
int in_gid(gid_t gid); | int in_gid(gid_t gid); | |||
int in_group(const char *name); | int in_group(const char *name); | |||
char* uid_to_name(uid_t uid); | char* uid_to_name(uid_t uid); | |||
char* gid_to_name(gid_t gid); | char* gid_to_name(gid_t gid); | |||
int glob_exists(const char *path); | int glob_exists(const char *path); | |||
int glob_extend(char ***strv, const char *path); | int glob_extend(char ***strv, const char *path); | |||
int dirent_ensure_type(DIR *d, struct dirent *de); | int dirent_ensure_type(DIR *d, struct dirent *de); | |||
int in_search_path(const char *path, char **search); | ||||
int get_files_in_directory(const char *path, char ***list); | int get_files_in_directory(const char *path, char ***list); | |||
char *strjoin(const char *x, ...) _sentinel_; | char *strjoin(const char *x, ...) _sentinel_; | |||
bool is_main_thread(void); | bool is_main_thread(void); | |||
bool in_charset(const char *s, const char* charset) _pure_; | static inline bool _pure_ in_charset(const char *s, const char* charset) { | |||
assert(s); | ||||
assert(charset); | ||||
return s[strspn(s, charset)] == '\0'; | ||||
} | ||||
int block_get_whole_disk(dev_t d, dev_t *ret); | int block_get_whole_disk(dev_t d, dev_t *ret); | |||
int file_is_priv_sticky(const char *p); | int file_is_priv_sticky(const char *p); | |||
int strdup_or_null(const char *a, char **b); | int strdup_or_null(const char *a, char **b); | |||
#define NULSTR_FOREACH(i, l) \ | #define NULSTR_FOREACH(i, l) \ | |||
for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1) | for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1) | |||
skipping to change at line 552 | skipping to change at line 632 | |||
int getenv_for_pid(pid_t pid, const char *field, char **_value); | int getenv_for_pid(pid_t pid, const char *field, char **_value); | |||
bool is_valid_documentation_url(const char *url) _pure_; | bool is_valid_documentation_url(const char *url) _pure_; | |||
bool in_initrd(void); | bool in_initrd(void); | |||
void warn_melody(void); | void warn_melody(void); | |||
int get_home_dir(char **ret); | int get_home_dir(char **ret); | |||
int get_shell(char **_ret); | ||||
static inline void freep(void *p) { | static inline void freep(void *p) { | |||
free(*(void**) p); | free(*(void**) p); | |||
} | } | |||
static inline void fclosep(FILE **f) { | #define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \ | |||
if (*f) | static inline void func##p(type *p) { \ | |||
fclose(*f); | if (*p) \ | |||
} | func(*p); \ | |||
} \ | ||||
static inline void pclosep(FILE **f) { | struct __useless_struct_to_allow_trailing_semicolon__ | |||
if (*f) | ||||
pclose(*f); | ||||
} | ||||
static inline void closep(int *fd) { | static inline void closep(int *fd) { | |||
if (*fd >= 0) | safe_close(*fd); | |||
close_nointr_nofail(*fd); | ||||
} | ||||
static inline void closedirp(DIR **d) { | ||||
if (*d) | ||||
closedir(*d); | ||||
} | } | |||
static inline void umaskp(mode_t *u) { | static inline void umaskp(mode_t *u) { | |||
umask(*u); | umask(*u); | |||
} | } | |||
static inline void close_pairp(int (*p)[2]) { | ||||
safe_close_pair(*p); | ||||
} | ||||
DEFINE_TRIVIAL_CLEANUP_FUNC(FILE*, fclose); | ||||
DEFINE_TRIVIAL_CLEANUP_FUNC(FILE*, pclose); | ||||
DEFINE_TRIVIAL_CLEANUP_FUNC(DIR*, closedir); | ||||
DEFINE_TRIVIAL_CLEANUP_FUNC(FILE*, endmntent); | ||||
#define _cleanup_free_ _cleanup_(freep) | #define _cleanup_free_ _cleanup_(freep) | |||
#define _cleanup_fclose_ _cleanup_(fclosep) | ||||
#define _cleanup_pclose_ _cleanup_(pclosep) | ||||
#define _cleanup_close_ _cleanup_(closep) | #define _cleanup_close_ _cleanup_(closep) | |||
#define _cleanup_closedir_ _cleanup_(closedirp) | ||||
#define _cleanup_umask_ _cleanup_(umaskp) | #define _cleanup_umask_ _cleanup_(umaskp) | |||
#define _cleanup_globfree_ _cleanup_(globfree) | #define _cleanup_globfree_ _cleanup_(globfree) | |||
#define _cleanup_fclose_ _cleanup_(fclosep) | ||||
#define _cleanup_pclose_ _cleanup_(pclosep) | ||||
#define _cleanup_closedir_ _cleanup_(closedirp) | ||||
#define _cleanup_endmntent_ _cleanup_(endmntentp) | ||||
#define _cleanup_close_pair_ _cleanup_(close_pairp) | ||||
_malloc_ _alloc_(1, 2) static inline void *malloc_multiply(size_t a, size_ t b) { | _malloc_ _alloc_(1, 2) static inline void *malloc_multiply(size_t a, size_ t b) { | |||
if (_unlikely_(b == 0 || a > ((size_t) -1) / b)) | if (_unlikely_(b != 0 && a > ((size_t) -1) / b)) | |||
return NULL; | return NULL; | |||
return malloc(a * b); | return malloc(a * b); | |||
} | } | |||
_alloc_(2, 3) static inline void *realloc_multiply(void *p, size_t a, size_ | ||||
t b) { | ||||
if (_unlikely_(b != 0 && a > ((size_t) -1) / b)) | ||||
return NULL; | ||||
return realloc(p, a * b); | ||||
} | ||||
_alloc_(2, 3) static inline void *memdup_multiply(const void *p, size_t a, size_t b) { | _alloc_(2, 3) static inline void *memdup_multiply(const void *p, size_t a, size_t b) { | |||
if (_unlikely_(b == 0 || a > ((size_t) -1) / b)) | if (_unlikely_(b != 0 && a > ((size_t) -1) / b)) | |||
return NULL; | return NULL; | |||
return memdup(p, a * b); | return memdup(p, a * b); | |||
} | } | |||
bool filename_is_safe(const char *p) _pure_; | bool filename_is_safe(const char *p) _pure_; | |||
bool path_is_safe(const char *p) _pure_; | bool path_is_safe(const char *p) _pure_; | |||
bool string_is_safe(const char *p) _pure_; | bool string_is_safe(const char *p) _pure_; | |||
bool string_has_cc(const char *p) _pure_; | bool string_has_cc(const char *p) _pure_; | |||
/** | ||||
* Check if a string contains any glob patterns. | ||||
*/ | ||||
_pure_ static inline bool string_is_glob(const char *p) { | ||||
return !!strpbrk(p, GLOB_CHARS); | ||||
} | ||||
void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t si ze, | void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t si ze, | |||
int (*compar) (const void *, const void *, void *), | int (*compar) (const void *, const void *, void *), | |||
void *arg); | void *arg); | |||
bool is_locale_utf8(void); | bool is_locale_utf8(void); | |||
typedef enum DrawSpecialChar { | typedef enum DrawSpecialChar { | |||
DRAW_TREE_VERT, | DRAW_TREE_VERTICAL, | |||
DRAW_TREE_BRANCH, | DRAW_TREE_BRANCH, | |||
DRAW_TREE_RIGHT, | DRAW_TREE_RIGHT, | |||
DRAW_TREE_SPACE, | DRAW_TREE_SPACE, | |||
DRAW_TRIANGULAR_BULLET, | DRAW_TRIANGULAR_BULLET, | |||
DRAW_BLACK_CIRCLE, | ||||
DRAW_ARROW, | ||||
DRAW_DASH, | ||||
_DRAW_SPECIAL_CHAR_MAX | _DRAW_SPECIAL_CHAR_MAX | |||
} DrawSpecialChar; | } DrawSpecialChar; | |||
const char *draw_special_char(DrawSpecialChar ch); | const char *draw_special_char(DrawSpecialChar ch); | |||
char *strreplace(const char *text, const char *old_string, const char *new_ string); | char *strreplace(const char *text, const char *old_string, const char *new_ string); | |||
char *strip_tab_ansi(char **p, size_t *l); | char *strip_tab_ansi(char **p, size_t *l); | |||
int on_ac_power(void); | int on_ac_power(void); | |||
int search_and_fopen(const char *path, const char *mode, const char **searc | int search_and_fopen(const char *path, const char *mode, const char *root, | |||
h, FILE **_f); | const char **search, FILE **_f); | |||
int search_and_fopen_nulstr(const char *path, const char *mode, const char | int search_and_fopen_nulstr(const char *path, const char *mode, const char | |||
*search, FILE **_f); | *root, const char *search, FILE **_f); | |||
int create_tmp_dir(char template[], char** dir_name); | ||||
#define FOREACH_LINE(line, f, on_error) \ | #define FOREACH_LINE(line, f, on_error) \ | |||
for (;;) \ | for (;;) \ | |||
if (!fgets(line, sizeof(line), f)) { \ | if (!fgets(line, sizeof(line), f)) { \ | |||
if (ferror(f)) { \ | if (ferror(f)) { \ | |||
on_error; \ | on_error; \ | |||
} \ | } \ | |||
break; \ | break; \ | |||
} else | } else | |||
skipping to change at line 665 | skipping to change at line 765 | |||
memset(s, c, n); | memset(s, c, n); | |||
return (uint8_t*)s + n; | return (uint8_t*)s + n; | |||
} | } | |||
char *hexmem(const void *p, size_t l); | char *hexmem(const void *p, size_t l); | |||
void *unhexmem(const char *p, size_t l); | void *unhexmem(const char *p, size_t l); | |||
char *strextend(char **x, ...) _sentinel_; | char *strextend(char **x, ...) _sentinel_; | |||
char *strrep(const char *s, unsigned n); | char *strrep(const char *s, unsigned n); | |||
void* greedy_realloc(void **p, size_t *allocated, size_t need); | void* greedy_realloc(void **p, size_t *allocated, size_t need, size_t size) | |||
#define GREEDY_REALLOC(array, allocated, need) \ | ; | |||
greedy_realloc((void**) &(array), &(allocated), sizeof((array)[0]) | void* greedy_realloc0(void **p, size_t *allocated, size_t need, size_t size | |||
* (need)) | ); | |||
#define GREEDY_REALLOC(array, allocated, need) \ | ||||
greedy_realloc((void**) &(array), &(allocated), (need), sizeof((arr | ||||
ay)[0])) | ||||
#define GREEDY_REALLOC0(array, allocated, need) \ | ||||
greedy_realloc0((void**) &(array), &(allocated), (need), sizeof((ar | ||||
ray)[0])) | ||||
static inline void _reset_errno_(int *saved_errno) { | static inline void _reset_errno_(int *saved_errno) { | |||
errno = *saved_errno; | errno = *saved_errno; | |||
} | } | |||
#define PROTECT_ERRNO _cleanup_(_reset_errno_) __attribute__((unused)) int _saved_errno_ = errno | #define PROTECT_ERRNO _cleanup_(_reset_errno_) __attribute__((unused)) int _saved_errno_ = errno | |||
struct _umask_struct_ { | struct _umask_struct_ { | |||
mode_t mask; | mode_t mask; | |||
bool quit; | bool quit; | |||
skipping to change at line 690 | skipping to change at line 794 | |||
static inline void _reset_umask_(struct _umask_struct_ *s) { | static inline void _reset_umask_(struct _umask_struct_ *s) { | |||
umask(s->mask); | umask(s->mask); | |||
}; | }; | |||
#define RUN_WITH_UMASK(mask) \ | #define RUN_WITH_UMASK(mask) \ | |||
for (_cleanup_(_reset_umask_) struct _umask_struct_ _saved_umask_ = { umask(mask), false }; \ | for (_cleanup_(_reset_umask_) struct _umask_struct_ _saved_umask_ = { umask(mask), false }; \ | |||
!_saved_umask_.quit ; \ | !_saved_umask_.quit ; \ | |||
_saved_umask_.quit = true) | _saved_umask_.quit = true) | |||
static inline unsigned u64log2(uint64_t n) { | static inline unsigned u64log2(uint64_t n) { | |||
return (n > 1) ? __builtin_clzll(n) ^ 63U : 0; | #if __SIZEOF_LONG_LONG__ == 8 | |||
return (n > 1) ? (unsigned) __builtin_clzll(n) ^ 63U : 0; | ||||
#else | ||||
#error "Wut?" | ||||
#endif | ||||
} | ||||
static inline unsigned u32ctz(uint32_t n) { | ||||
#if __SIZEOF_INT__ == 4 | ||||
return __builtin_ctz(n); | ||||
#else | ||||
#error "Wut?" | ||||
#endif | ||||
} | ||||
static inline int log2i(int x) { | ||||
assert(x > 0); | ||||
return __SIZEOF_INT__ * 8 - __builtin_clz(x) - 1; | ||||
} | } | |||
static inline bool logind_running(void) { | static inline bool logind_running(void) { | |||
return access("/run/systemd/seats/", F_OK) >= 0; | return access("/run/systemd/seats/", F_OK) >= 0; | |||
} | } | |||
#define DECIMAL_STR_WIDTH(x) \ | #define DECIMAL_STR_WIDTH(x) \ | |||
({ \ | ({ \ | |||
typeof(x) _x_ = (x); \ | typeof(x) _x_ = (x); \ | |||
unsigned ans = 1; \ | unsigned ans = 1; \ | |||
skipping to change at line 728 | skipping to change at line 850 | |||
const char *_a_ = (a), *_b_ = (b); \ | const char *_a_ = (a), *_b_ = (b); \ | |||
char *_c_; \ | char *_c_; \ | |||
size_t _x_, _y_; \ | size_t _x_, _y_; \ | |||
_x_ = strlen(_a_); \ | _x_ = strlen(_a_); \ | |||
_y_ = strlen(_b_); \ | _y_ = strlen(_b_); \ | |||
_c_ = alloca(_x_ + _y_ + 1); \ | _c_ = alloca(_x_ + _y_ + 1); \ | |||
strcpy(stpcpy(_c_, _a_), _b_); \ | strcpy(stpcpy(_c_, _a_), _b_); \ | |||
_c_; \ | _c_; \ | |||
}) | }) | |||
#define strappenda3(a, b, c) \ | ||||
({ \ | ||||
const char *_a_ = (a), *_b_ = (b), *_c_ = (c); \ | ||||
char *_d_; \ | ||||
size_t _x_, _y_, _z_; \ | ||||
_x_ = strlen(_a_); \ | ||||
_y_ = strlen(_b_); \ | ||||
_z_ = strlen(_c_); \ | ||||
_d_ = alloca(_x_ + _y_ + _z_ + 1); \ | ||||
strcpy(stpcpy(stpcpy(_d_, _a_), _b_), _c_); \ | ||||
_d_; \ | ||||
}) | ||||
#define procfs_file_alloca(pid, field) \ | #define procfs_file_alloca(pid, field) \ | |||
({ \ | ({ \ | |||
pid_t _pid_ = (pid); \ | pid_t _pid_ = (pid); \ | |||
char *_r_; \ | const char *_r_; \ | |||
_r_ = alloca(sizeof("/proc/") -1 + DECIMAL_STR_MAX(pid_t) + | if (_pid_ == 0) { \ | |||
1 + sizeof(field)); \ | _r_ = ("/proc/self/" field); \ | |||
sprintf(_r_, "/proc/%lu/" field, (unsigned long) _pid_); \ | } else { \ | |||
_r_ = alloca(strlen("/proc/") + DECIMAL_STR_MAX(pid | ||||
_t) + 1 + sizeof(field)); \ | ||||
sprintf((char*) _r_, "/proc/"PID_FMT"/" field, _pid | ||||
_); \ | ||||
} \ | ||||
_r_; \ | _r_; \ | |||
}) | }) | |||
struct _locale_struct_ { | struct _locale_struct_ { | |||
locale_t saved_locale; | locale_t saved_locale; | |||
locale_t new_locale; | locale_t new_locale; | |||
bool quit; | bool quit; | |||
}; | }; | |||
static inline void _reset_locale_(struct _locale_struct_ *s) { | static inline void _reset_locale_(struct _locale_struct_ *s) { | |||
skipping to change at line 764 | skipping to change at line 903 | |||
if (!_saved_locale_.quit) { \ | if (!_saved_locale_.quit) { \ | |||
PROTECT_ERRNO; \ | PROTECT_ERRNO; \ | |||
_saved_locale_.new_locale = newlocale((mask), (loc), (locale_t) 0); \ | _saved_locale_.new_locale = newlocale((mask), (loc), (locale_t) 0); \ | |||
if (_saved_locale_.new_locale != (locale_t) 0) \ | if (_saved_locale_.new_locale != (locale_t) 0) \ | |||
_saved_locale_.saved_locale = uselocal e(_saved_locale_.new_locale); \ | _saved_locale_.saved_locale = uselocal e(_saved_locale_.new_locale); \ | |||
} \ | } \ | |||
!_saved_locale_.quit; }) ; \ | !_saved_locale_.quit; }) ; \ | |||
_saved_locale_.quit = true) | _saved_locale_.quit = true) | |||
bool id128_is_valid(const char *s) _pure_; | bool id128_is_valid(const char *s) _pure_; | |||
void parse_user_at_host(char *arg, char **user, char **host); | ||||
int split_pair(const char *s, const char *sep, char **l, char **r); | int split_pair(const char *s, const char *sep, char **l, char **r); | |||
int shall_restore_state(void); | ||||
/** | ||||
* Normal qsort requires base to be nonnull. Here were require | ||||
* that only if nmemb > 0. | ||||
*/ | ||||
static inline void qsort_safe(void *base, size_t nmemb, size_t size, | ||||
int (*compar)(const void *, const void *)) { | ||||
if (nmemb) { | ||||
assert(base); | ||||
qsort(base, nmemb, size, compar); | ||||
} | ||||
} | ||||
int proc_cmdline(char **ret); | ||||
int parse_proc_cmdline(int (*parse_word)(const char *key, const char *value | ||||
)); | ||||
int container_get_leader(const char *machine, pid_t *pid); | ||||
int namespace_open(pid_t pid, int *pidns_fd, int *mntns_fd, int *netns_fd, | ||||
int *root_fd); | ||||
int namespace_enter(int pidns_fd, int mntns_fd, int netns_fd, int root_fd); | ||||
bool pid_is_alive(pid_t pid); | ||||
bool pid_is_unwaited(pid_t pid); | ||||
int getpeercred(int fd, struct ucred *ucred); | ||||
int getpeersec(int fd, char **ret); | ||||
int writev_safe(int fd, const struct iovec *w, int j); | ||||
int mkostemp_safe(char *pattern, int flags); | ||||
int open_tmpfile(const char *path, int flags); | ||||
int fd_warn_permissions(const char *path, int fd); | ||||
unsigned long personality_from_string(const char *p); | ||||
const char *personality_to_string(unsigned long); | ||||
uint64_t physical_memory(void); | ||||
char* mount_test_option(const char *haystack, const char *needle); | ||||
void hexdump(FILE *f, const void *p, size_t s); | ||||
union file_handle_union { | ||||
struct file_handle handle; | ||||
char padding[sizeof(struct file_handle) + MAX_HANDLE_SZ]; | ||||
}; | ||||
int update_reboot_param_file(const char *param); | ||||
int umount_recursive(const char *target, int flags); | ||||
int bind_remount_recursive(const char *prefix, bool ro); | ||||
int fflush_and_check(FILE *f); | ||||
char *tempfn_xxxxxx(const char *p); | ||||
char *tempfn_random(const char *p); | ||||
bool is_localhost(const char *hostname); | ||||
End of changes. 55 change blocks. | ||||
74 lines changed or deleted | 219 lines changed or added | |||
utmp-wtmp.h | utmp-wtmp.h | |||
---|---|---|---|---|
skipping to change at line 35 | skipping to change at line 35 | |||
int utmp_get_runlevel(int *runlevel, int *previous); | int utmp_get_runlevel(int *runlevel, int *previous); | |||
int utmp_put_shutdown(void); | int utmp_put_shutdown(void); | |||
int utmp_put_reboot(usec_t timestamp); | int utmp_put_reboot(usec_t timestamp); | |||
int utmp_put_runlevel(int runlevel, int previous); | int utmp_put_runlevel(int runlevel, int previous); | |||
int utmp_put_dead_process(const char *id, pid_t pid, int code, int status); | int utmp_put_dead_process(const char *id, pid_t pid, int code, int status); | |||
int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line); | int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line); | |||
int utmp_wall(const char *message, bool (*match_tty)(const char *tty)); | int utmp_wall(const char *message, const char *username, bool (*match_tty)( const char *tty)); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
virt.h | virt.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
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/>. | |||
***/ | ***/ | |||
int detect_vm(const char **id); | int detect_vm(const char **id); | |||
int detect_container(const char **id); | int detect_container(const char **id); | |||
typedef enum Virtualization { | enum { | |||
VIRTUALIZATION_NONE = 0, | VIRTUALIZATION_NONE = 0, | |||
VIRTUALIZATION_VM, | VIRTUALIZATION_VM, | |||
VIRTUALIZATION_CONTAINER, | VIRTUALIZATION_CONTAINER, | |||
_VIRTUALIZATION_MAX, | _VIRTUALIZATION_MAX, | |||
_VIRTUALIZATION_INVALID = -1 | _VIRTUALIZATION_INVALID = -1 | |||
} Virtualization; | }; | |||
Virtualization detect_virtualization(const char **id); | int detect_virtualization(const char **id); | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||