acl-util.h | acl-util.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooaclutilhfoo | #pragma once | |||
#define fooaclutilhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 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); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
ask-password-api.h | ask-password-api.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooaskpasswordapihfoo | #pragma once | |||
#define fooaskpasswordapihfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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, bool accept_cached, char ***_passphrases); | int ask_password_agent(const char *message, const char *icon, usec_t until, bool accept_cached, char ***_passphrases); | |||
int ask_password_auto(const char *message, const char *icon, usec_t until, bool accept_cached, char ***_passphrases); | int ask_password_auto(const char *message, const char *icon, usec_t until, bool accept_cached, char ***_passphrases); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
automount.h | automount.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooautomounthfoo | #pragma once | |||
#define fooautomounthfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 Automount Automount; | typedef struct Automount Automount; | |||
#include "unit.h" | #include "unit.h" | |||
typedef enum AutomountState { | typedef enum AutomountState { | |||
AUTOMOUNT_DEAD, | AUTOMOUNT_DEAD, | |||
AUTOMOUNT_WAITING, | AUTOMOUNT_WAITING, | |||
skipping to change at line 75 | skipping to change at line 74 | |||
int automount_send_ready(Automount *a, int status); | int automount_send_ready(Automount *a, int status); | |||
int automount_add_one_mount_link(Automount *a, Mount *m); | int automount_add_one_mount_link(Automount *a, Mount *m); | |||
const char* automount_state_to_string(AutomountState i); | const char* automount_state_to_string(AutomountState i); | |||
AutomountState automount_state_from_string(const char *s); | AutomountState automount_state_from_string(const char *s); | |||
const char* automount_result_to_string(AutomountResult i); | const char* automount_result_to_string(AutomountResult i); | |||
AutomountResult automount_result_from_string(const char *s); | AutomountResult automount_result_from_string(const char *s); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
build.h | build.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foobuildhfoo | #pragma once | |||
#define foobuildhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 | #ifdef HAVE_LIBWRAP | |||
skipping to change at line 49 | skipping to change at line 48 | |||
#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_IMA | ||||
#define _IMA_FEATURE_ "+IMA" | ||||
#else | ||||
#define _IMA_FEATURE_ "-IMA" | ||||
#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" | |||
#endif | #endif | |||
#ifdef HAVE_LIBCRYPTSETUP | #ifdef HAVE_LIBCRYPTSETUP | |||
#define _LIBCRYPTSETUP_FEATURE_ "+LIBCRYPTSETUP" | #define _LIBCRYPTSETUP_FEATURE_ "+LIBCRYPTSETUP" | |||
#else | #else | |||
#define _LIBCRYPTSETUP_FEATURE_ "-LIBCRYPTSETUP" | #define _LIBCRYPTSETUP_FEATURE_ "-LIBCRYPTSETUP" | |||
#endif | #endif | |||
#define SYSTEMD_FEATURES _PAM_FEATURE_ " " _LIBWRAP_FEATURE_ " " _AUDIT_FEA | #define SYSTEMD_FEATURES _PAM_FEATURE_ " " _LIBWRAP_FEATURE_ " " _AUDIT_FEA | |||
TURE_ " " _SELINUX_FEATURE_ " " _SYSVINIT_FEATURE_ " " _LIBCRYPTSETUP_FEATU | TURE_ " " _SELINUX_FEATURE_ " " _IMA_FEATURE_ " " _SYSVINIT_FEATURE_ " " _L | |||
RE_ | IBCRYPTSETUP_FEATURE_ | |||
#endif | ||||
End of changes. 6 change blocks. | ||||
6 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 -*-*/ | |||
#ifndef foobuserrorshfoo | #pragma once | |||
#define foobuserrorshfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <string.h> | #include <string.h> | |||
#include <dbus/dbus.h> | #include <dbus/dbus.h> | |||
#define BUS_ERROR_NO_SUCH_UNIT "org.freedesktop.systemd1.NoSuchUnit" | #define BUS_ERROR_NO_SUCH_UNIT "org.freedesktop.systemd1.NoSuchUnit" | |||
#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_INVALID_PATH "org.freedesktop.systemd1.InvalidPath" | |||
skipping to change at line 57 | skipping to change at line 56 | |||
static inline const char *bus_error(const DBusError *e, int r) { | static inline const char *bus_error(const DBusError *e, int r) { | |||
if (e && e->message) | if (e && e->message) | |||
return e->message; | return e->message; | |||
if (r >= 0) | if (r >= 0) | |||
return strerror(r); | return strerror(r); | |||
return strerror(-r); | return strerror(-r); | |||
} | } | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
cgroup-attr.h | cgroup-attr.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foocgroupattrhfoo | #pragma once | |||
#define foocgroupattrhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 CGroupAttribute CGroupAttribute; | typedef struct CGroupAttribute CGroupAttribute; | |||
typedef int (*CGroupAttributeMapCallback)(const char *controller, const cha r*name, const char *value, char **ret); | typedef int (*CGroupAttributeMapCallback)(const char *controller, const cha r*name, const char *value, char **ret); | |||
#include "unit.h" | #include "unit.h" | |||
#include "cgroup.h" | #include "cgroup.h" | |||
skipping to change at line 48 | skipping to change at line 47 | |||
LIST_FIELDS(CGroupAttribute, by_unit); | LIST_FIELDS(CGroupAttribute, by_unit); | |||
}; | }; | |||
int cgroup_attribute_apply(CGroupAttribute *a, CGroupBonding *b); | int cgroup_attribute_apply(CGroupAttribute *a, CGroupBonding *b); | |||
int cgroup_attribute_apply_list(CGroupAttribute *first, CGroupBonding *b); | int cgroup_attribute_apply_list(CGroupAttribute *first, CGroupBonding *b); | |||
CGroupAttribute *cgroup_attribute_find_list(CGroupAttribute *first, const c har *controller, const char *name); | CGroupAttribute *cgroup_attribute_find_list(CGroupAttribute *first, const c har *controller, const char *name); | |||
void cgroup_attribute_free_list(CGroupAttribute *first); | void cgroup_attribute_free_list(CGroupAttribute *first); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
cgroup-show.h | cgroup-show.h | |||
---|---|---|---|---|
skipping to change at line 12 | skipping to change at line 12 | |||
#ifndef foocgroupshowhfoo | #ifndef foocgroupshowhfoo | |||
#define foocgroupshowhfoo | #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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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> | ||||
int show_cgroup_by_path(const char *path, const char *prefix, unsigned colu | int show_cgroup_by_path(const char *path, const char *prefix, unsigned colu | |||
mns, bool kernel_threads); | mns, bool kernel_threads, bool all); | |||
int show_cgroup(const char *controller, const char *path, const char *prefi | int show_cgroup(const char *controller, const char *path, const char *prefi | |||
x, unsigned columns, bool kernel_threads); | x, unsigned columns, bool kernel_threads, bool all); | |||
int show_cgroup_and_extra_by_spec(const char *spec, const char *prefix, uns | ||||
igned n_columns, bool kernel_threads, bool all, const pid_t extra_pids[], u | ||||
nsigned n_extra_pids); | ||||
int show_cgroup_and_extra(const char *controller, const char *path, const c | ||||
har *prefix, unsigned n_columns, bool kernel_threads, bool all, const pid_t | ||||
extra_pids[], unsigned n_extra_pids); | ||||
#endif | #endif | |||
End of changes. 5 change blocks. | ||||
8 lines changed or deleted | 16 lines changed or added | |||
cgroup-util.h | cgroup-util.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foocgrouputilhfoo | #pragma once | |||
#define foocgrouputilhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <stdio.h> | #include <stdio.h> | |||
#include <dirent.h> | #include <dirent.h> | |||
#include "set.h" | #include "set.h" | |||
#include "def.h" | #include "def.h" | |||
skipping to change at line 51 | skipping to change at line 50 | |||
int cg_kill_recursive_and_wait(const char *controller, const char *path, bo ol remove); | int cg_kill_recursive_and_wait(const char *controller, const char *path, bo ol remove); | |||
int cg_migrate(const char *controller, const char *from, const char *to, bo ol ignore_self); | int cg_migrate(const char *controller, const char *from, const char *to, bo ol ignore_self); | |||
int cg_migrate_recursive(const char *controller, const char *from, const ch ar *to, bool ignore_self, bool remove); | int cg_migrate_recursive(const char *controller, const char *from, const ch ar *to, bool ignore_self, bool remove); | |||
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_join_spec(const char *controller, const char *path, char **spec); | |||
int cg_fix_path(const char *path, char **result); | int cg_fix_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_by_pid(const char *controller, pid_t pid, char **path); | int cg_get_by_pid(const char *controller, pid_t pid, char **path); | |||
int cg_trim(const char *controller, const char *path, bool delete_root); | int cg_trim(const char *controller, const char *path, bool delete_root); | |||
int cg_rmdir(const char *controller, const char *path, bool honour_sticky); | int cg_rmdir(const char *controller, const char *path, bool honour_sticky); | |||
int cg_delete(const char *controller, const char *path); | int cg_delete(const char *controller, const char *path); | |||
int cg_create(const char *controller, const char *path); | int cg_create(const char *controller, const char *path); | |||
int cg_attach(const char *controller, const char *path, pid_t pid); | int cg_attach(const char *controller, const char *path, pid_t pid); | |||
int cg_create_and_attach(const char *controller, const char *path, pid_t pi d); | int cg_create_and_attach(const char *controller, const char *path, pid_t pi d); | |||
int cg_set_group_access(const char *controller, const char *path, mode_t mo de, uid_t uid, gid_t gid); | int cg_set_group_access(const char *controller, const char *path, mode_t mo de, uid_t uid, gid_t gid); | |||
int cg_set_task_access(const char *controller, const char *path, mode_t mod e, uid_t uid, gid_t gid, int sticky); | int cg_set_task_access(const char *controller, const char *path, mode_t mod e, uid_t uid, gid_t gid, int sticky); | |||
int cg_install_release_agent(const char *controller, const char *agent); | int cg_install_release_agent(const char *controller, const char *agent); | |||
int cg_is_empty(const char *controller, const char *path, bool ignore_self) ; | int cg_is_empty(const char *controller, const char *path, bool ignore_self) ; | |||
int cg_is_empty_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_user_path(char **path); | int cg_get_user_path(char **path); | |||
int cg_pid_get_cgroup(pid_t pid, char **root, char **cgroup); | ||||
int cg_pid_get_unit(pid_t pid, char **unit); | ||||
#endif | char **cg_shorten_controllers(char **controllers); | |||
End of changes. 7 change blocks. | ||||
6 lines changed or deleted | 8 lines changed or added | |||
cgroup.h | cgroup.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foocgrouphfoo | #pragma once | |||
#define foocgrouphfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
typedef struct CGroupBonding CGroupBonding; | typedef struct CGroupBonding CGroupBonding; | |||
#include "unit.h" | #include "unit.h" | |||
/* Binds a cgroup to a name */ | /* Binds a cgroup to a name */ | |||
struct CGroupBonding { | struct CGroupBonding { | |||
char *controller; | char *controller; | |||
skipping to change at line 59 | skipping to change at line 58 | |||
/* This cgroup is realized */ | /* This cgroup is realized */ | |||
bool realized:1; | bool realized:1; | |||
}; | }; | |||
int cgroup_bonding_realize(CGroupBonding *b); | int cgroup_bonding_realize(CGroupBonding *b); | |||
int cgroup_bonding_realize_list(CGroupBonding *first); | int cgroup_bonding_realize_list(CGroupBonding *first); | |||
void cgroup_bonding_free(CGroupBonding *b, bool trim); | void cgroup_bonding_free(CGroupBonding *b, bool trim); | |||
void cgroup_bonding_free_list(CGroupBonding *first, bool trim); | void cgroup_bonding_free_list(CGroupBonding *first, bool trim); | |||
int cgroup_bonding_install(CGroupBonding *b, pid_t pid); | int cgroup_bonding_install(CGroupBonding *b, pid_t pid, const char *suffix) | |||
int cgroup_bonding_install_list(CGroupBonding *first, pid_t pid); | ; | |||
int cgroup_bonding_install_list(CGroupBonding *first, pid_t pid, const char | ||||
*suffix); | ||||
int cgroup_bonding_set_group_access(CGroupBonding *b, mode_t mode, uid_t ui d, gid_t gid); | int cgroup_bonding_set_group_access(CGroupBonding *b, mode_t mode, uid_t ui d, gid_t gid); | |||
int cgroup_bonding_set_group_access_list(CGroupBonding *b, mode_t mode, uid _t uid, gid_t gid); | int cgroup_bonding_set_group_access_list(CGroupBonding *b, mode_t mode, uid _t uid, gid_t gid); | |||
int cgroup_bonding_set_task_access(CGroupBonding *b, mode_t mode, uid_t uid , gid_t gid, int sticky); | int cgroup_bonding_set_task_access(CGroupBonding *b, mode_t mode, uid_t uid , gid_t gid, int sticky); | |||
int cgroup_bonding_set_task_access_list(CGroupBonding *b, mode_t mode, uid_ t uid, gid_t gid, int sticky); | int cgroup_bonding_set_task_access_list(CGroupBonding *b, mode_t mode, uid_ t uid, gid_t gid, int sticky); | |||
int cgroup_bonding_kill(CGroupBonding *b, int sig, bool sigcont, Set *s); | int cgroup_bonding_kill(CGroupBonding *b, int sig, bool sigcont, bool rem, | |||
int cgroup_bonding_kill_list(CGroupBonding *first, int sig, bool sigcont, S | Set *s, const char *suffix); | |||
et *s); | int cgroup_bonding_kill_list(CGroupBonding *first, int sig, bool sigcont, b | |||
ool rem, Set *s, const char *suffix); | ||||
void cgroup_bonding_trim(CGroupBonding *first, bool delete_root); | void cgroup_bonding_trim(CGroupBonding *first, bool delete_root); | |||
void cgroup_bonding_trim_list(CGroupBonding *first, bool delete_root); | void cgroup_bonding_trim_list(CGroupBonding *first, bool delete_root); | |||
int cgroup_bonding_is_empty(CGroupBonding *b); | int cgroup_bonding_is_empty(CGroupBonding *b); | |||
int cgroup_bonding_is_empty_list(CGroupBonding *first); | int cgroup_bonding_is_empty_list(CGroupBonding *first); | |||
CGroupBonding *cgroup_bonding_find_list(CGroupBonding *first, const char *c ontroller); | CGroupBonding *cgroup_bonding_find_list(CGroupBonding *first, const char *c ontroller); | |||
char *cgroup_bonding_to_string(CGroupBonding *b); | char *cgroup_bonding_to_string(CGroupBonding *b); | |||
skipping to change at line 93 | skipping to change at line 92 | |||
#include "manager.h" | #include "manager.h" | |||
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); | |||
int cgroup_bonding_get(Manager *m, const char *cgroup, CGroupBonding **bond ing); | int cgroup_bonding_get(Manager *m, const char *cgroup, CGroupBonding **bond ing); | |||
int cgroup_notify_empty(Manager *m, const char *group); | int cgroup_notify_empty(Manager *m, const char *group); | |||
Unit* cgroup_unit_by_pid(Manager *m, pid_t pid); | Unit* cgroup_unit_by_pid(Manager *m, pid_t pid); | |||
#endif | ||||
End of changes. 7 change blocks. | ||||
11 lines changed or deleted | 13 lines changed or added | |||
compress.h | compress.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foocompresshfoo | #pragma once | |||
#define foocompresshfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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> | |||
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); | void **dst, uint64_t *dst_alloc_size, uint64_t* dst_si ze); | |||
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); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
condition.h | condition.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooconditionhfoo | #pragma once | |||
#define fooconditionhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 "list.h" | #include "list.h" | |||
typedef enum ConditionType { | typedef enum ConditionType { | |||
CONDITION_PATH_EXISTS, | CONDITION_PATH_EXISTS, | |||
CONDITION_PATH_EXISTS_GLOB, | CONDITION_PATH_EXISTS_GLOB, | |||
CONDITION_PATH_IS_DIRECTORY, | CONDITION_PATH_IS_DIRECTORY, | |||
CONDITION_PATH_IS_SYMBOLIC_LINK, | CONDITION_PATH_IS_SYMBOLIC_LINK, | |||
CONDITION_PATH_IS_MOUNT_POINT, | CONDITION_PATH_IS_MOUNT_POINT, | |||
CONDITION_PATH_IS_READ_WRITE, | ||||
CONDITION_DIRECTORY_NOT_EMPTY, | CONDITION_DIRECTORY_NOT_EMPTY, | |||
CONDITION_FILE_IS_EXECUTABLE, | CONDITION_FILE_IS_EXECUTABLE, | |||
CONDITION_KERNEL_COMMAND_LINE, | CONDITION_KERNEL_COMMAND_LINE, | |||
CONDITION_VIRTUALIZATION, | CONDITION_VIRTUALIZATION, | |||
CONDITION_SECURITY, | CONDITION_SECURITY, | |||
CONDITION_CAPABILITY, | CONDITION_CAPABILITY, | |||
CONDITION_NULL, | CONDITION_NULL, | |||
_CONDITION_TYPE_MAX, | _CONDITION_TYPE_MAX, | |||
_CONDITION_TYPE_INVALID = -1 | _CONDITION_TYPE_INVALID = -1 | |||
} ConditionType; | } ConditionType; | |||
skipping to change at line 68 | skipping to change at line 68 | |||
void condition_free_list(Condition *c); | void condition_free_list(Condition *c); | |||
bool condition_test(Condition *c); | bool condition_test(Condition *c); | |||
bool condition_test_list(Condition *c); | bool condition_test_list(Condition *c); | |||
void condition_dump(Condition *c, FILE *f, const char *prefix); | void condition_dump(Condition *c, FILE *f, const char *prefix); | |||
void condition_dump_list(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 char* condition_type_to_string(ConditionType t); | |||
int condition_type_from_string(const char *s); | int condition_type_from_string(const char *s); | |||
#endif | ||||
End of changes. 6 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added | |||
conf-parser.h | conf-parser.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooconfparserhfoo | #pragma once | |||
#define fooconfparserhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <stdbool.h> | #include <stdbool.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 */ | |||
skipping to change at line 105 | skipping to change at line 104 | |||
int config_parse_uint64(const char *filename, unsigned line, const char *se ction, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_uint64(const char *filename, unsigned line, const char *se ction, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_bytes_size(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, v oid *userdata); | int config_parse_bytes_size(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, v oid *userdata); | |||
int config_parse_bytes_off(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, vo id *userdata); | int config_parse_bytes_off(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, vo id *userdata); | |||
int config_parse_bool(const char *filename, unsigned line, const char *sect ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u serdata); | int config_parse_bool(const char *filename, unsigned line, const char *sect ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u serdata); | |||
int config_parse_tristate(const char *filename, unsigned line, const char * section, const char *lvalue, int ltype, const char *rvalue, void *data, voi d *userdata); | int config_parse_tristate(const char *filename, unsigned line, const char * section, const char *lvalue, int ltype, const char *rvalue, void *data, voi d *userdata); | |||
int config_parse_string(const char *filename, unsigned line, const char *se ction, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_string(const char *filename, unsigned line, const char *se ction, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_path(const char *filename, unsigned line, const char *sect ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u serdata); | int config_parse_path(const char *filename, unsigned line, const char *sect ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u serdata); | |||
int config_parse_strv(const char *filename, unsigned line, const char *sect ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u serdata); | int config_parse_strv(const char *filename, unsigned line, const char *sect ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u serdata); | |||
int config_parse_path_strv(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, vo id *userdata); | int config_parse_path_strv(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, vo id *userdata); | |||
int config_parse_usec(const char *filename, unsigned line, const char *sect ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u serdata); | int config_parse_usec(const char *filename, unsigned line, const char *sect ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u serdata); | |||
int config_parse_nsec(const char *filename, unsigned line, const char *sect ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u serdata); | ||||
int config_parse_mode(const char *filename, unsigned line, const char *sect ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u serdata); | int config_parse_mode(const char *filename, unsigned line, const char *sect ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u serdata); | |||
int config_parse_facility(const char *filename, unsigned line, const char * | ||||
section, const char *lvalue, int ltype, const char *rvalue, void *data, voi | ||||
d *userdata); | ||||
int config_parse_level(const char *filename, unsigned line, const char *sec | ||||
tion, const char *lvalue, int ltype, const char *rvalue, void *data, void * | ||||
userdata); | ||||
#define DEFINE_CONFIG_PARSE_ENUM(function,name,type,msg) \ | #define DEFINE_CONFIG_PARSE_ENUM(function,name,type,msg) \ | |||
int function( \ | int function( \ | |||
const char *filename, \ | const char *filename, \ | |||
unsigned line, \ | unsigned line, \ | |||
const char *section, \ | const char *section, \ | |||
const char *lvalue, \ | const char *lvalue, \ | |||
int ltype, \ | int ltype, \ | |||
const char *rvalue, \ | const char *rvalue, \ | |||
void *data, \ | void *data, \ | |||
skipping to change at line 134 | skipping to change at line 136 | |||
\ | \ | |||
if ((x = name##_from_string(rvalue)) < 0) { \ | if ((x = name##_from_string(rvalue)) < 0) { \ | |||
log_error("[%s:%u] " msg ", ignoring: %s", filename , line, rvalue); \ | log_error("[%s:%u] " msg ", ignoring: %s", filename , line, rvalue); \ | |||
return 0; \ | return 0; \ | |||
} \ | } \ | |||
\ | \ | |||
*i = x; \ | *i = x; \ | |||
\ | \ | |||
return 0; \ | return 0; \ | |||
} | } | |||
#endif | ||||
End of changes. 7 change blocks. | ||||
6 lines changed or deleted | 12 lines changed or added | |||
config.h | config.h | |||
---|---|---|---|---|
skipping to change at line 25 | skipping to change at line 25 | |||
/* 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 | |||
/* AUDIT available */ | /* AUDIT available */ | |||
#define HAVE_AUDIT 1 | #define HAVE_AUDIT 1 | |||
/* 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 | |||
/* Define if GTK is available */ | /* Define if IMA is available */ | |||
#define HAVE_GTK 1 | #define HAVE_IMA 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 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 */ | |||
#define HAVE_LIBCRYPTSETUP 1 | /* #undef HAVE_LIBCRYPTSETUP */ | |||
/* Have tcpwrap? */ | /* Have tcpwrap? */ | |||
#define HAVE_LIBWRAP /**/ | #define HAVE_LIBWRAP /**/ | |||
/* Logind support available */ | /* Logind support available */ | |||
#define HAVE_LOGIND 1 | #define HAVE_LOGIND 1 | |||
/* 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 | |||
skipping to change at line 108 | skipping to change at line 108 | |||
*/ | */ | |||
#define LT_OBJDIR ".libs/" | #define LT_OBJDIR ".libs/" | |||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */ | /* Define to 1 if your C compiler doesn't accept -c and -o together. */ | |||
/* #undef NO_MINUS_C_MINUS_O */ | /* #undef NO_MINUS_C_MINUS_O */ | |||
/* 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 "systemd-devel@lists.freedesktop.org" | #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 44" | #define PACKAGE_STRING "systemd 187" | |||
/* 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 "" | #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 "44" | #define PACKAGE_VERSION "187" | |||
/* 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 | |||
/* Target is ALTLinux */ | /* Target is ALTLinux */ | |||
/* #undef TARGET_ALTLINUX */ | /* #undef TARGET_ALTLINUX */ | |||
/* Target is Ångström */ | /* Target is Ångström */ | |||
/* #undef TARGET_ANGSTROM */ | /* #undef TARGET_ANGSTROM */ | |||
skipping to change at line 155 | skipping to change at line 155 | |||
/* Target is Gentoo */ | /* Target is Gentoo */ | |||
/* #undef TARGET_GENTOO */ | /* #undef TARGET_GENTOO */ | |||
/* Target is Mageia */ | /* Target is Mageia */ | |||
/* #undef TARGET_MAGEIA */ | /* #undef TARGET_MAGEIA */ | |||
/* Target is Mandriva */ | /* Target is Mandriva */ | |||
/* #undef TARGET_MANDRIVA */ | /* #undef TARGET_MANDRIVA */ | |||
/* Target is MeeGo */ | ||||
/* #undef TARGET_MEEGO */ | ||||
/* Target is Slackware */ | /* Target is Slackware */ | |||
/* #undef TARGET_SLACKWARE */ | /* #undef TARGET_SLACKWARE */ | |||
/* Target is openSUSE/SLE */ | /* Target is openSUSE/SLE */ | |||
/* #undef TARGET_SUSE */ | /* #undef TARGET_SUSE */ | |||
/* Target is Ubuntu */ | /* Target is Ubuntu */ | |||
/* #undef TARGET_UBUNTU */ | /* #undef TARGET_UBUNTU */ | |||
/* GID of the 'tty' group */ | /* GID of the 'tty' group */ | |||
skipping to change at line 192 | skipping to change at line 189 | |||
/* 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 "44" | #define VERSION "187" | |||
/* Enable large inode numbers on Mac OS X 10.5. */ | ||||
#ifndef _DARWIN_USE_64_BIT_INODE | ||||
# define _DARWIN_USE_64_BIT_INODE 1 | ||||
#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. */ | |||
/* #undef _LARGE_FILES */ | /* #undef _LARGE_FILES */ | |||
/* Define to 1 if on MINIX. */ | /* Define to 1 if on MINIX. */ | |||
/* #undef _MINIX */ | /* #undef _MINIX */ | |||
End of changes. 8 change blocks. | ||||
11 lines changed or deleted | 13 lines changed or added | |||
dbus-automount.h | dbus-automount.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbusautomounthfoo | #pragma once | |||
#define foodbusautomounthfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_automount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message); | DBusHandlerResult bus_automount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message); | |||
extern const char bus_automount_interface[]; | extern const char bus_automount_interface[]; | |||
extern const char bus_automount_invalidating_properties[]; | extern const char bus_automount_invalidating_properties[]; | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
dbus-common.h | dbus-common.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbuscommonhfoo | #pragma once | |||
#define foodbuscommonhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#ifndef DBUS_ERROR_UNKNOWN_OBJECT | #ifndef DBUS_ERROR_UNKNOWN_OBJECT | |||
#define DBUS_ERROR_UNKNOWN_OBJECT "org.freedesktop.DBus.Error.UnknownObject " | #define DBUS_ERROR_UNKNOWN_OBJECT "org.freedesktop.DBus.Error.UnknownObject " | |||
#endif | #endif | |||
#ifndef DBUS_ERROR_UNKNOWN_INTERFACE | #ifndef DBUS_ERROR_UNKNOWN_INTERFACE | |||
skipping to change at line 94 | skipping to change at line 93 | |||
"org.freedesktop.DBus.Peer\0" | "org.freedesktop.DBus.Peer\0" | |||
int bus_check_peercred(DBusConnection *c); | int bus_check_peercred(DBusConnection *c); | |||
int bus_connect(DBusBusType t, DBusConnection **_bus, bool *private_bus, DB usError *error); | int bus_connect(DBusBusType t, DBusConnection **_bus, bool *private_bus, DB usError *error); | |||
int bus_connect_system_ssh(const char *user, const char *host, DBusConnecti on **_bus, DBusError *error); | int bus_connect_system_ssh(const char *user, const char *host, DBusConnecti on **_bus, DBusError *error); | |||
int bus_connect_system_polkit(DBusConnection **_bus, DBusError *error); | int bus_connect_system_polkit(DBusConnection **_bus, DBusError *error); | |||
const char *bus_error_message(const DBusError *error); | const char *bus_error_message(const DBusError *error); | |||
const char *bus_error_message_or_strerror(const DBusError *error, int err); | ||||
typedef int (*BusPropertyCallback)(DBusMessageIter *iter, const char *prope rty, void *data); | typedef int (*BusPropertyCallback)(DBusMessageIter *iter, const char *prope rty, void *data); | |||
typedef int (*BusPropertySetCallback)(DBusMessageIter *iter, const char *pr operty); | typedef int (*BusPropertySetCallback)(DBusMessageIter *iter, const char *pr operty, void *data); | |||
typedef struct BusProperty { | typedef struct BusProperty { | |||
const char *property; /* name of the property */ | const char *property; /* name of the property */ | |||
BusPropertyCallback append; /* Function that is called to seri alize this property */ | BusPropertyCallback append; /* Function that is called to seri alize this property */ | |||
const char *signature; | const char *signature; | |||
const uint16_t offset; /* Offset from BusBoundProperties: :base address to the property data. | const uint16_t offset; /* Offset from BusBoundProperties: :base address to the property data. | |||
* uint16_t is sufficient, because we have no structs too big. | * uint16_t is sufficient, because we have no structs too big. | |||
* -Werror=overflow will catch it if this does not hold. */ | * -Werror=overflow will catch it if this does not hold. */ | |||
bool indirect; /* data is indirect, ie. not base+ offset, but *(base+offset) */ | bool indirect; /* data is indirect, ie. not base+ offset, but *(base+offset) */ | |||
BusPropertySetCallback set; /* Optional: Function that is call ed to set this property */ | BusPropertySetCallback set; /* Optional: Function that is call ed to set this property */ | |||
skipping to change at line 147 | skipping to change at line 147 | |||
int bus_property_append_long(DBusMessageIter *i, const char *property, void *data); | int bus_property_append_long(DBusMessageIter *i, const char *property, void *data); | |||
#define bus_property_append_int bus_property_append_int32 | #define bus_property_append_int bus_property_append_int32 | |||
#define bus_property_append_pid bus_property_append_uint32 | #define bus_property_append_pid bus_property_append_uint32 | |||
#define bus_property_append_uid bus_property_append_uint32 | #define bus_property_append_uid bus_property_append_uint32 | |||
#define bus_property_append_gid bus_property_append_uint32 | #define bus_property_append_gid bus_property_append_uint32 | |||
#define bus_property_append_mode bus_property_append_uint32 | #define bus_property_append_mode bus_property_append_uint32 | |||
#define bus_property_append_unsigned bus_property_append_uint32 | #define bus_property_append_unsigned bus_property_append_uint32 | |||
#define bus_property_append_usec bus_property_append_uint64 | #define bus_property_append_usec bus_property_append_uint64 | |||
int bus_property_set_uint64(DBusMessageIter *i, const char *property, void | ||||
*data); | ||||
#define bus_property_set_usec bus_property_set_uint64 | ||||
#define DEFINE_BUS_PROPERTY_APPEND_ENUM(function,name,type) \ | #define DEFINE_BUS_PROPERTY_APPEND_ENUM(function,name,type) \ | |||
int function(DBusMessageIter *i, const char *property, void *data) { \ | int function(DBusMessageIter *i, const char *property, void *data) { \ | |||
const char *value; \ | const char *value; \ | |||
type *field = data; \ | type *field = data; \ | |||
\ | \ | |||
assert(i); \ | assert(i); \ | |||
assert(property); \ | assert(property); \ | |||
\ | \ | |||
value = name##_to_string(*field); \ | value = strempty(name##_to_string(*field)); \ | |||
\ | \ | |||
if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &v alue)) \ | if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &v alue)) \ | |||
return -ENOMEM; \ | return -ENOMEM; \ | |||
\ | \ | |||
return 0; \ | return 0; \ | |||
} | } | |||
#define DEFINE_BUS_PROPERTY_SET_ENUM(function,name,type) \ | ||||
int function(DBusMessageIter *i, const char *property, void *data) | ||||
{ \ | ||||
const char *value; \ | ||||
type f, *field = data; \ | ||||
\ | ||||
assert(i); \ | ||||
assert(property); \ | ||||
\ | ||||
dbus_message_iter_get_basic(i, &value); \ | ||||
\ | ||||
f = name##_from_string(value); \ | ||||
if (f < 0) \ | ||||
return f; \ | ||||
\ | ||||
*field = f; \ | ||||
return 0; \ | ||||
} | ||||
const char *bus_errno_to_dbus(int error); | const char *bus_errno_to_dbus(int error); | |||
DBusMessage* bus_properties_changed_new(const char *path, const char *inter face, const char *properties); | DBusMessage* bus_properties_changed_new(const char *path, const char *inter face, const char *properties); | |||
DBusMessage* bus_properties_changed_one_new(const char *path, const char *i nterface, const char *property); | ||||
uint32_t bus_flags_to_events(DBusWatch *bus_watch); | uint32_t bus_flags_to_events(DBusWatch *bus_watch); | |||
unsigned bus_events_to_flags(uint32_t events); | unsigned bus_events_to_flags(uint32_t events); | |||
int bus_parse_strv(DBusMessage *m, char ***_l); | int bus_parse_strv(DBusMessage *m, char ***_l); | |||
int bus_parse_strv_iter(DBusMessageIter *iter, char ***_l); | int bus_parse_strv_iter(DBusMessageIter *iter, char ***_l); | |||
int bus_append_strv_iter(DBusMessageIter *iter, char **l); | int bus_append_strv_iter(DBusMessageIter *iter, char **l); | |||
int bus_iter_get_basic_and_next(DBusMessageIter *iter, int type, void *data , bool next); | int bus_iter_get_basic_and_next(DBusMessageIter *iter, int type, void *data , bool next); | |||
int generic_print_property(const char *name, DBusMessageIter *iter, bool al l); | int generic_print_property(const char *name, DBusMessageIter *iter, bool al l); | |||
void bus_async_unregister_and_exit(DBusConnection *bus, const char *name); | void bus_async_unregister_and_exit(DBusConnection *bus, const char *name); | |||
DBusHandlerResult bus_exit_idle_filter(DBusConnection *bus, DBusMessage *m, void *userdata); | DBusHandlerResult bus_exit_idle_filter(DBusConnection *bus, DBusMessage *m, void *userdata); | |||
#endif | pid_t bus_get_unix_process_id(DBusConnection *connection, const char *name, DBusError *error); | |||
End of changes. 11 change blocks. | ||||
8 lines changed or deleted | 32 lines changed or added | |||
dbus-device.h | dbus-device.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbusdevicehfoo | #pragma once | |||
#define foodbusdevicehfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_device_message_handler(Unit *u, DBusConnection *c, DB usMessage *message); | DBusHandlerResult bus_device_message_handler(Unit *u, DBusConnection *c, DB usMessage *message); | |||
extern const char bus_device_interface[]; | extern const char bus_device_interface[]; | |||
extern const char bus_device_invalidating_properties[]; | extern const char bus_device_invalidating_properties[]; | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
dbus-execute.h | dbus-execute.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbusexecutehfoo | #pragma once | |||
#define foodbusexecutehfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include "manager.h" | #include "manager.h" | |||
#include "dbus-common.h" | #include "dbus-common.h" | |||
#define BUS_EXEC_STATUS_INTERFACE(prefix) \ | #define BUS_EXEC_STATUS_INTERFACE(prefix) \ | |||
" <property name=\"" prefix "StartTimestamp\" type=\"t\" access=\" read\"/>\n" \ | " <property name=\"" prefix "StartTimestamp\" type=\"t\" access=\" read\"/>\n" \ | |||
skipping to change at line 99 | skipping to change at line 98 | |||
" <property name=\"InaccessibleDirectories\" type=\"as\" access=\" read\"/>\n" \ | " <property name=\"InaccessibleDirectories\" type=\"as\" access=\" read\"/>\n" \ | |||
" <property name=\"MountFlags\" type=\"t\" access=\"read\"/>\n" \ | " <property name=\"MountFlags\" type=\"t\" access=\"read\"/>\n" \ | |||
" <property name=\"PrivateTmp\" type=\"b\" access=\"read\"/>\n" \ | " <property name=\"PrivateTmp\" type=\"b\" access=\"read\"/>\n" \ | |||
" <property name=\"SameProcessGroup\" type=\"b\" access=\"read\"/> \n" \ | " <property name=\"SameProcessGroup\" type=\"b\" access=\"read\"/> \n" \ | |||
" <property name=\"KillMode\" type=\"s\" access=\"read\"/>\n" \ | " <property name=\"KillMode\" type=\"s\" access=\"read\"/>\n" \ | |||
" <property name=\"KillSignal\" type=\"i\" access=\"read\"/>\n" \ | " <property name=\"KillSignal\" type=\"i\" access=\"read\"/>\n" \ | |||
" <property name=\"UtmpIdentifier\" type=\"s\" access=\"read\"/>\n " \ | " <property name=\"UtmpIdentifier\" type=\"s\" access=\"read\"/>\n " \ | |||
" <property name=\"ControlGroupModify\" type=\"b\" access=\"read\" />\n" \ | " <property name=\"ControlGroupModify\" type=\"b\" access=\"read\" />\n" \ | |||
" <property name=\"ControlGroupPersistent\" type=\"b\" access=\"re ad\"/>\n" \ | " <property name=\"ControlGroupPersistent\" type=\"b\" access=\"re ad\"/>\n" \ | |||
" <property name=\"PrivateNetwork\" type=\"b\" access=\"read\"/>\n " \ | " <property name=\"PrivateNetwork\" type=\"b\" access=\"read\"/>\n " \ | |||
" <property name=\"IgnoreSIGPIPE\" type=\"b\" 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) \ | #define BUS_EXEC_COMMAND_INTERFACE(name) \ | |||
" <property name=\"" name "\" type=\"a(sasbttuii)\" access=\"read\ "/>\n" | " <property name=\"" name "\" type=\"a(sasbttuii)\" access=\"read\ "/>\n" | |||
extern const BusProperty bus_exec_context_properties[]; | extern const BusProperty bus_exec_context_properties[]; | |||
#define BUS_EXEC_COMMAND_PROPERTY(name, command, indirect) \ | #define BUS_EXEC_COMMAND_PROPERTY(name, command, indirect) \ | |||
{ name, bus_execute_append_command, "a(sasbttttuii)", (command), (i ndirect), NULL } | { name, bus_execute_append_command, "a(sasbttttuii)", (command), (i ndirect), NULL } | |||
int bus_execute_append_output(DBusMessageIter *i, const char *property, voi d *data); | int bus_execute_append_output(DBusMessageIter *i, const char *property, voi d *data); | |||
skipping to change at line 122 | skipping to change at line 123 | |||
int bus_execute_append_nice(DBusMessageIter *i, const char *property, void *data); | int bus_execute_append_nice(DBusMessageIter *i, const char *property, void *data); | |||
int bus_execute_append_ioprio(DBusMessageIter *i, const char *property, voi d *data); | int bus_execute_append_ioprio(DBusMessageIter *i, const char *property, voi d *data); | |||
int bus_execute_append_cpu_sched_policy(DBusMessageIter *i, const char *pro perty, void *data); | int bus_execute_append_cpu_sched_policy(DBusMessageIter *i, const char *pro perty, void *data); | |||
int bus_execute_append_cpu_sched_priority(DBusMessageIter *i, const char *p roperty, void *data); | int bus_execute_append_cpu_sched_priority(DBusMessageIter *i, const char *p roperty, void *data); | |||
int bus_execute_append_affinity(DBusMessageIter *i, const char *property, v oid *data); | int bus_execute_append_affinity(DBusMessageIter *i, const char *property, v oid *data); | |||
int bus_execute_append_timer_slack_nsec(DBusMessageIter *i, const char *pro perty, void *data); | int bus_execute_append_timer_slack_nsec(DBusMessageIter *i, const char *pro perty, void *data); | |||
int bus_execute_append_capabilities(DBusMessageIter *i, const char *propert y, void *data); | int bus_execute_append_capabilities(DBusMessageIter *i, const char *propert y, void *data); | |||
int bus_execute_append_capability_bs(DBusMessageIter *i, const char *proper ty, void *data); | int bus_execute_append_capability_bs(DBusMessageIter *i, const char *proper ty, void *data); | |||
int bus_execute_append_rlimits(DBusMessageIter *i, const char *property, vo id *data); | int bus_execute_append_rlimits(DBusMessageIter *i, const char *property, vo id *data); | |||
int bus_execute_append_command(DBusMessageIter *u, const char *property, vo id *data); | int bus_execute_append_command(DBusMessageIter *u, const char *property, vo id *data); | |||
int bus_execute_append_kill_mode(DBusMessageIter *i, const char *property, void *data); | ||||
int bus_execute_append_env_files(DBusMessageIter *i, const char *property, void *data); | int bus_execute_append_env_files(DBusMessageIter *i, const char *property, void *data); | |||
int bus_execute_append_syscall_filter(DBusMessageIter *i, const char *prope | ||||
#endif | rty, void *data); | |||
End of changes. 7 change blocks. | ||||
8 lines changed or deleted | 11 lines changed or added | |||
dbus-job.h | dbus-job.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbusjobhfoo | #pragma once | |||
#define foodbusjobhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include "job.h" | #include "job.h" | |||
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 DBusObjectPathVTable bus_job_vtable; | |||
extern const char bus_job_interface[]; | extern const char bus_job_interface[]; | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
dbus-loop.h | dbus-loop.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbusloophfoo | #pragma once | |||
#define foodbusloophfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
int bus_loop_open(DBusConnection *c); | int bus_loop_open(DBusConnection *c); | |||
int bus_loop_dispatch(int fd); | int bus_loop_dispatch(int fd); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
dbus-manager.h | dbus-manager.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbusmanagerhfoo | #pragma once | |||
#define foodbusmanagerhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
extern const DBusObjectPathVTable bus_manager_vtable; | extern const DBusObjectPathVTable bus_manager_vtable; | |||
extern const char bus_manager_interface[]; | extern const char bus_manager_interface[]; | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
dbus-mount.h | dbus-mount.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbusmounthfoo | #pragma once | |||
#define foodbusmounthfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_mount_message_handler(Unit *u, DBusConnection *c, DBu sMessage *message); | DBusHandlerResult bus_mount_message_handler(Unit *u, DBusConnection *c, DBu sMessage *message); | |||
extern const char bus_mount_interface[]; | extern const char bus_mount_interface[]; | |||
extern const char bus_mount_invalidating_properties[]; | extern const char bus_mount_invalidating_properties[]; | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
dbus-path.h | dbus-path.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbuspathhfoo | #pragma once | |||
#define foodbuspathhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_path_message_handler(Unit *u, DBusConnection *c, DBus Message *message); | DBusHandlerResult bus_path_message_handler(Unit *u, DBusConnection *c, DBus Message *message); | |||
extern const char bus_path_interface[]; | extern const char bus_path_interface[]; | |||
extern const char bus_path_invalidating_properties[]; | extern const char bus_path_invalidating_properties[]; | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
dbus-service.h | dbus-service.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbusservicehfoo | #pragma once | |||
#define foodbusservicehfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_service_message_handler(Unit *u, DBusConnection *c, D BusMessage *message); | DBusHandlerResult bus_service_message_handler(Unit *u, DBusConnection *c, D BusMessage *message); | |||
extern const char bus_service_interface[]; | extern const char bus_service_interface[]; | |||
extern const char bus_service_invalidating_properties[]; | extern const char bus_service_invalidating_properties[]; | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
dbus-snapshot.h | dbus-snapshot.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbussnapshothfoo | #pragma once | |||
#define foodbussnapshothfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusConnection *c, DBusMessage *message); | DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusConnection *c, DBusMessage *message); | |||
extern const char bus_snapshot_interface[]; | extern const char bus_snapshot_interface[]; | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
dbus-socket.h | dbus-socket.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbussockethfoo | #pragma once | |||
#define foodbussockethfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_socket_message_handler(Unit *u, DBusConnection *c, DB usMessage *message); | DBusHandlerResult bus_socket_message_handler(Unit *u, DBusConnection *c, DB usMessage *message); | |||
extern const char bus_socket_interface[]; | extern const char bus_socket_interface[]; | |||
extern const char bus_socket_invalidating_properties[]; | extern const char bus_socket_invalidating_properties[]; | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
dbus-swap.h | dbus-swap.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbusswaphfoo | #pragma once | |||
#define foodbusswaphfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2010 Lennart Poettering | Copyright 2010 Lennart Poettering | |||
Copyright 2010 Maarten Lankhorst | Copyright 2010 Maarten Lankhorst | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_swap_message_handler(Unit *u, DBusConnection *c, DBus Message *message); | DBusHandlerResult bus_swap_message_handler(Unit *u, DBusConnection *c, DBus Message *message); | |||
extern const char bus_swap_interface[]; | extern const char bus_swap_interface[]; | |||
extern const char bus_swap_invalidating_properties[]; | extern const char bus_swap_invalidating_properties[]; | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
dbus-target.h | dbus-target.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbustargethfoo | #pragma once | |||
#define foodbustargethfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_target_message_handler(Unit *u, DBusConnection *c, DB usMessage *message); | DBusHandlerResult bus_target_message_handler(Unit *u, DBusConnection *c, DB usMessage *message); | |||
extern const char bus_target_interface[]; | extern const char bus_target_interface[]; | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
dbus-timer.h | dbus-timer.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbustimerhfoo | #pragma once | |||
#define foodbustimerhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include "unit.h" | #include "unit.h" | |||
DBusHandlerResult bus_timer_message_handler(Unit *u, DBusConnection *c, DBu sMessage *message); | DBusHandlerResult bus_timer_message_handler(Unit *u, DBusConnection *c, DBu sMessage *message); | |||
extern const char bus_timer_interface[]; | extern const char bus_timer_interface[]; | |||
extern const char bus_timer_invalidating_properties[]; | extern const char bus_timer_invalidating_properties[]; | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
dbus-unit.h | dbus-unit.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbusunithfoo | #pragma once | |||
#define foodbusunithfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include "manager.h" | #include "manager.h" | |||
#include "dbus-common.h" | #include "dbus-common.h" | |||
#define BUS_UNIT_INTERFACE \ | #define BUS_UNIT_INTERFACE \ | |||
" <interface name=\"org.freedesktop.systemd1.Unit\">\n" \ | " <interface name=\"org.freedesktop.systemd1.Unit\">\n" \ | |||
skipping to change at line 62 | skipping to change at line 61 | |||
" <method name=\"ReloadOrRestart\">\n" \ | " <method name=\"ReloadOrRestart\">\n" \ | |||
" <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | |||
" <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | |||
" </method>\n" \ | " </method>\n" \ | |||
" <method name=\"ReloadOrTryRestart\">\n" \ | " <method name=\"ReloadOrTryRestart\">\n" \ | |||
" <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | |||
" <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | |||
" </method>\n" \ | " </method>\n" \ | |||
" <method name=\"Kill\">\n" \ | " <method name=\"Kill\">\n" \ | |||
" <arg name=\"who\" type=\"s\" direction=\"in\"/>\n" \ | " <arg name=\"who\" type=\"s\" direction=\"in\"/>\n" \ | |||
" <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | ||||
" <arg name=\"signal\" type=\"i\" direction=\"in\"/>\n" \ | " <arg name=\"signal\" type=\"i\" direction=\"in\"/>\n" \ | |||
" </method>\n" \ | " </method>\n" \ | |||
" <method name=\"ResetFailed\"/>\n" \ | " <method name=\"ResetFailed\"/>\n" \ | |||
" <property name=\"Id\" type=\"s\" access=\"read\"/>\n" \ | " <property name=\"Id\" type=\"s\" access=\"read\"/>\n" \ | |||
" <property name=\"Names\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"Names\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"Following\" type=\"s\" access=\"read\"/>\n" \ | " <property name=\"Following\" type=\"s\" access=\"read\"/>\n" \ | |||
" <property name=\"Requires\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"Requires\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"RequiresOverridable\" type=\"as\" access=\"read \"/>\n" \ | " <property name=\"RequiresOverridable\" type=\"as\" access=\"read \"/>\n" \ | |||
" <property name=\"Requisite\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"Requisite\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"RequisiteOverridable\" type=\"as\" access=\"rea d\"/>\n" \ | " <property name=\"RequisiteOverridable\" type=\"as\" access=\"rea d\"/>\n" \ | |||
" <property name=\"Wants\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"Wants\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"BindTo\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"BindsTo\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"RequiredBy\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"RequiredBy\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"RequiredByOverridable\" type=\"as\" access=\"re ad\"/>\n" \ | " <property name=\"RequiredByOverridable\" type=\"as\" access=\"re ad\"/>\n" \ | |||
" <property name=\"WantedBy\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"WantedBy\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"BoundBy\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"BoundBy\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"Conflicts\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"Conflicts\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"ConflictedBy\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"ConflictedBy\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"Before\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"Before\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"After\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"After\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"OnFailure\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"OnFailure\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"Triggers\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"Triggers\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"TriggeredBy\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"TriggeredBy\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"PropagateReloadTo\" type=\"as\" access=\"read\" | " <property name=\"PropagatesReloadTo\" type=\"as\" access=\"read\ | |||
/>\n" \ | "/>\n" \ | |||
" <property name=\"PropagateReloadFrom\" type=\"as\" access=\"read | " <property name=\"ReloadPropagatedFrom\" type=\"as\" access=\"rea | |||
\"/>\n" \ | d\"/>\n" \ | |||
" <property name=\"RequiresMountsFor\" type=\"as\" access=\"read\" | ||||
/>\n" \ | ||||
" <property name=\"Description\" type=\"s\" access=\"read\"/>\n" \ | " <property name=\"Description\" type=\"s\" access=\"read\"/>\n" \ | |||
" <property name=\"SourcePath\" type=\"s\" access=\"read\"/>\n" \ | ||||
" <property name=\"Documentation\" type=\"as\" access=\"read\"/>\n | ||||
" \ | ||||
" <property name=\"LoadState\" type=\"s\" access=\"read\"/>\n" \ | " <property name=\"LoadState\" type=\"s\" access=\"read\"/>\n" \ | |||
" <property name=\"ActiveState\" type=\"s\" access=\"read\"/>\n" \ | " <property name=\"ActiveState\" type=\"s\" access=\"read\"/>\n" \ | |||
" <property name=\"SubState\" type=\"s\" access=\"read\"/>\n" \ | " <property name=\"SubState\" type=\"s\" access=\"read\"/>\n" \ | |||
" <property name=\"FragmentPath\" type=\"s\" access=\"read\"/>\n" \ | " <property name=\"FragmentPath\" type=\"s\" access=\"read\"/>\n" \ | |||
" <property name=\"UnitFileState\" type=\"s\" access=\"read\"/>\n" \ | " <property name=\"UnitFileState\" type=\"s\" access=\"read\"/>\n" \ | |||
" <property name=\"InactiveExitTimestamp\" type=\"t\" access=\"rea d\"/>\n" \ | " <property name=\"InactiveExitTimestamp\" type=\"t\" access=\"rea d\"/>\n" \ | |||
" <property name=\"InactiveExitTimestampMonotonic\" type=\"t\" acc ess=\"read\"/>\n" \ | " <property name=\"InactiveExitTimestampMonotonic\" type=\"t\" acc ess=\"read\"/>\n" \ | |||
" <property name=\"ActiveEnterTimestamp\" type=\"t\" access=\"read \"/>\n" \ | " <property name=\"ActiveEnterTimestamp\" type=\"t\" access=\"read \"/>\n" \ | |||
" <property name=\"ActiveEnterTimestampMonotonic\" type=\"t\" acce ss=\"read\"/>\n" \ | " <property name=\"ActiveEnterTimestampMonotonic\" type=\"t\" acce ss=\"read\"/>\n" \ | |||
" <property name=\"ActiveExitTimestamp\" type=\"t\" access=\"read\ "/>\n" \ | " <property name=\"ActiveExitTimestamp\" type=\"t\" access=\"read\ "/>\n" \ | |||
skipping to change at line 138 | skipping to change at line 139 | |||
"org.freedesktop.systemd1.Unit\0" | "org.freedesktop.systemd1.Unit\0" | |||
extern const BusProperty bus_unit_properties[]; | extern const BusProperty bus_unit_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); | |||
extern const DBusObjectPathVTable bus_unit_vtable; | extern const DBusObjectPathVTable bus_unit_vtable; | |||
extern const char bus_unit_interface[]; | extern const char bus_unit_interface[]; | |||
#endif | ||||
End of changes. 9 change blocks. | ||||
12 lines changed or deleted | 15 lines changed or added | |||
dbus.h | dbus.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodbushfoo | #pragma once | |||
#define foodbushfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include "manager.h" | #include "manager.h" | |||
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); | |||
skipping to change at line 52 | skipping to change at line 51 | |||
bool bus_connection_has_subscriber(Manager *m, DBusConnection *c); | 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 kernel_usec, usec_t initrd_u sec, usec_t userspace_usec, usec_t total_usec); | void bus_broadcast_finished(Manager *m, usec_t kernel_usec, usec_t initrd_u sec, usec_t userspace_usec, usec_t total_usec); | |||
#define BUS_CONNECTION_SUBSCRIBED(m, c) dbus_connection_get_data((c), (m)-> subscribed_data_slot) | #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) | #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[]; | extern const char * const bus_interface_table[]; | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
def.h | def.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodefhfoo | #pragma once | |||
#define foodefhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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_EXIT_USEC (5*USEC_PER_MINUTE) | #define DEFAULT_EXIT_USEC (5*USEC_PER_MINUTE) | |||
#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 SIGKILL,SIGPIPE | #define SIGNALS_IGNORE SIGKILL,SIGPIPE | |||
#endif | ||||
End of changes. 6 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added | |||
device.h | device.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foodevicehfoo | #pragma once | |||
#define foodevicehfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 Device Device; | typedef struct Device Device; | |||
#include "unit.h" | #include "unit.h" | |||
/* We simply watch devices, we cannot plug/unplug them. That | /* We simply watch devices, we cannot plug/unplug them. That | |||
* simplifies the state engine greatly */ | * simplifies the state engine greatly */ | |||
typedef enum DeviceState { | typedef enum DeviceState { | |||
skipping to change at line 58 | skipping to change at line 57 | |||
DeviceState state; | DeviceState state; | |||
}; | }; | |||
extern const UnitVTable device_vtable; | extern const UnitVTable device_vtable; | |||
void device_fd_event(Manager *m, int events); | void device_fd_event(Manager *m, int events); | |||
const char* device_state_to_string(DeviceState i); | const char* device_state_to_string(DeviceState i); | |||
DeviceState device_state_from_string(const char *s); | DeviceState device_state_from_string(const char *s); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
execute.h | execute.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooexecutehfoo | #pragma once | |||
#define fooexecutehfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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; | |||
#include <linux/types.h> | #include <linux/types.h> | |||
#include <sys/time.h> | #include <sys/time.h> | |||
#include <sys/resource.h> | #include <sys/resource.h> | |||
skipping to change at line 43 | skipping to change at line 42 | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#include <sched.h> | #include <sched.h> | |||
struct CGroupBonding; | struct CGroupBonding; | |||
struct CGroupAttribute; | struct CGroupAttribute; | |||
#include "list.h" | #include "list.h" | |||
#include "util.h" | #include "util.h" | |||
typedef enum KillMode { | ||||
KILL_CONTROL_GROUP = 0, | ||||
KILL_PROCESS, | ||||
KILL_NONE, | ||||
_KILL_MODE_MAX, | ||||
_KILL_MODE_INVALID = -1 | ||||
} KillMode; | ||||
typedef enum KillWho { | ||||
KILL_MAIN, | ||||
KILL_CONTROL, | ||||
KILL_ALL, | ||||
_KILL_WHO_MAX, | ||||
_KILL_WHO_INVALID = -1 | ||||
} KillWho; | ||||
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 121 | skipping to change at line 104 | |||
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; | |||
unsigned long timer_slack_nsec; | nsec_t timer_slack_nsec; | |||
char *tcpwrap_name; | 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; | |||
skipping to change at line 150 | skipping to change at line 133 | |||
char *pam_name; | char *pam_name; | |||
char *utmp_id; | char *utmp_id; | |||
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; | |||
/* Not relevant for spawning processes, just for killing */ | ||||
KillMode kill_mode; | ||||
int kill_signal; | ||||
bool send_sigkill; | ||||
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; | |||
bool no_new_privileges; | ||||
bool control_group_modify; | bool control_group_modify; | |||
int control_group_persistent; | int control_group_persistent; | |||
/* 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; | ||||
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 timer_slack_nsec_set:1; | ||||
}; | }; | |||
int exec_spawn(ExecCommand *command, | int exec_spawn(ExecCommand *command, | |||
char **argv, | char **argv, | |||
const ExecContext *context, | const 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, | |||
struct CGroupBonding *cgroup_bondings, | struct CGroupBonding *cgroup_bondings, | |||
struct CGroupAttribute *cgroup_attributes, | struct CGroupAttribute *cgroup_attributes, | |||
const char *cgroup_suffix, | ||||
const char *unit_id, | ||||
int pipe_fd[2], | ||||
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); | |||
skipping to change at line 226 | skipping to change at line 210 | |||
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); | |||
const char* exec_output_to_string(ExecOutput i); | const char* exec_output_to_string(ExecOutput i); | |||
ExecOutput exec_output_from_string(const char *s); | ExecOutput exec_output_from_string(const char *s); | |||
const char* exec_input_to_string(ExecInput i); | const char* exec_input_to_string(ExecInput i); | |||
ExecInput exec_input_from_string(const char *s); | ExecInput exec_input_from_string(const char *s); | |||
const char *kill_mode_to_string(KillMode k); | ||||
KillMode kill_mode_from_string(const char *s); | ||||
const char *kill_who_to_string(KillWho k); | ||||
KillWho kill_who_from_string(const char *s); | ||||
#endif | ||||
End of changes. 12 change blocks. | ||||
29 lines changed or deleted | 13 lines changed or added | |||
exit-status.h | exit-status.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooexitstatushfoo | #pragma once | |||
#define fooexitstatushfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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> | |||
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, | |||
skipping to change at line 69 | skipping to change at line 68 | |||
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_TCPWRAP, | |||
EXIT_PAM, | EXIT_PAM, | |||
EXIT_NETWORK, | EXIT_NETWORK, | |||
EXIT_NAMESPACE | EXIT_NAMESPACE, | |||
EXIT_NO_NEW_PRIVILEGES, | ||||
EXIT_SECCOMP | ||||
} 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; | |||
const char* exit_status_to_string(ExitStatus status, ExitStatusLevel level) ; | const char* exit_status_to_string(ExitStatus status, ExitStatusLevel level) ; | |||
bool is_clean_exit(int code, int status); | bool is_clean_exit(int code, int status); | |||
bool is_clean_exit_lsb(int code, int status); | bool is_clean_exit_lsb(int code, int status); | |||
#endif | ||||
End of changes. 6 change blocks. | ||||
8 lines changed or deleted | 8 lines changed or added | |||
fdset.h | fdset.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foofdsethfoo | #pragma once | |||
#define foofdsethfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 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); | |||
int fdset_remove(FDSet *s, int fd); | int fdset_remove(FDSet *s, int fd); | |||
int fdset_new_fill(FDSet **_s); | int fdset_new_fill(FDSet **_s); | |||
int fdset_cloexec(FDSet *fds, bool b); | int fdset_cloexec(FDSet *fds, bool b); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
hashmap.h | hashmap.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foohashmaphfoo | #pragma once | |||
#define foohashmaphfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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> | |||
/* 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. */ | |||
skipping to change at line 74 | skipping to change at line 73 | |||
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); | unsigned hashmap_size(Hashmap *h); | |||
bool hashmap_isempty(Hashmap *h); | bool hashmap_isempty(Hashmap *h); | |||
void *hashmap_iterate(Hashmap *h, Iterator *i, const void **key); | void *hashmap_iterate(Hashmap *h, Iterator *i, const void **key); | |||
void *hashmap_iterate_backwards(Hashmap *h, Iterator *i, const void **key); | void *hashmap_iterate_backwards(Hashmap *h, Iterator *i, const void **key); | |||
void *hashmap_iterate_skip(Hashmap *h, const void *key, Iterator *i); | void *hashmap_iterate_skip(Hashmap *h, const void *key, Iterator *i); | |||
void hashmap_clear(Hashmap *h); | void hashmap_clear(Hashmap *h); | |||
void hashmap_clear_free(Hashmap *h); | ||||
void *hashmap_steal_first(Hashmap *h); | void *hashmap_steal_first(Hashmap *h); | |||
void *hashmap_steal_first_key(Hashmap *h); | void *hashmap_steal_first_key(Hashmap *h); | |||
void* hashmap_first(Hashmap *h); | void* hashmap_first(Hashmap *h); | |||
void* hashmap_first_key(Hashmap *h); | void* hashmap_first_key(Hashmap *h); | |||
void* hashmap_last(Hashmap *h); | void* hashmap_last(Hashmap *h); | |||
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)) | |||
#endif | ||||
End of changes. 6 change blocks. | ||||
6 lines changed or deleted | 7 lines changed or added | |||
hostname-setup.h | hostname-setup.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foohostnamesetuphfoo | #pragma once | |||
#define foohostnamesetuphfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 hostname_setup(void); | int hostname_setup(void); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
install.h | install.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooinstallhfoo | #pragma once | |||
#define fooinstallhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 enum UnitFileScope { | typedef enum UnitFileScope { | |||
UNIT_FILE_SYSTEM, | UNIT_FILE_SYSTEM, | |||
UNIT_FILE_GLOBAL, | UNIT_FILE_GLOBAL, | |||
UNIT_FILE_USER, | UNIT_FILE_USER, | |||
_UNIT_FILE_SCOPE_MAX, | _UNIT_FILE_SCOPE_MAX, | |||
skipping to change at line 88 | skipping to change at line 87 | |||
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 *name); | |||
const char *unit_file_state_to_string(UnitFileState s); | const char *unit_file_state_to_string(UnitFileState s); | |||
UnitFileState unit_file_state_from_string(const char *s); | UnitFileState unit_file_state_from_string(const char *s); | |||
const char *unit_file_change_type_to_string(UnitFileChangeType s); | const char *unit_file_change_type_to_string(UnitFileChangeType s); | |||
UnitFileChangeType unit_file_change_type_from_string(const char *s); | UnitFileChangeType unit_file_change_type_from_string(const char *s); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
job.h | job.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foojobhfoo | #pragma once | |||
#define foojobhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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> | ||||
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; | |||
#include "manager.h" | /* Be careful when changing the job types! Adjust job_merging_table[] accor | |||
#include "unit.h" | dingly! */ | |||
#include "hashmap.h" | ||||
#include "list.h" | ||||
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, | |||
JOB_STOP, | JOB_STOP, | |||
JOB_RELOAD, /* if running reload */ | JOB_RELOAD, /* if running, reload */ | |||
JOB_RELOAD_OR_START, /* if running reload, if not running st | ||||
art */ | ||||
/* Note that restarts are first treated like JOB_STOP, but | /* Note that restarts are first treated like JOB_STOP, but | |||
* then instead of finishing are patched to become | * then instead of finishing are patched to become | |||
* JOB_START. */ | * JOB_START. */ | |||
JOB_RESTART, /* if running stop, then start uncondit | JOB_RESTART, /* If running, stop. Then start uncondi | |||
ionally */ | tionally. */ | |||
JOB_TRY_RESTART, /* if running stop and then start */ | ||||
_JOB_TYPE_MAX_MERGING, | ||||
/* JOB_NOP can enter into a transaction, but as it won't pull in | ||||
* any dependencies, it won't have to merge with anything. | ||||
* job_install() avoids the problem of merging JOB_NOP too (it's | ||||
* special-cased, only merges with other JOB_NOPs). */ | ||||
JOB_NOP = _JOB_TYPE_MAX_MERGING, /* do nothing */ | ||||
_JOB_TYPE_MAX_IN_TRANSACTION, | ||||
/* JOB_TRY_RESTART can never appear in a transaction, because | ||||
* it always collapses into JOB_RESTART or JOB_NOP before entering. | ||||
* Thus we never need to merge it with anything. */ | ||||
JOB_TRY_RESTART = _JOB_TYPE_MAX_IN_TRANSACTION, /* if running, stop | ||||
and then start */ | ||||
/* JOB_RELOAD_OR_START won't enter into a transaction and cannot re | ||||
sult | ||||
* from transaction merging (there's no way for JOB_RELOAD and | ||||
* JOB_START to meet in one transaction). It can result from a merg | ||||
e | ||||
* during job installation, but then it will immediately collapse i | ||||
nto | ||||
* one of the two simpler types. */ | ||||
JOB_RELOAD_OR_START, /* if running, reload, otherwise start | ||||
*/ | ||||
_JOB_TYPE_MAX, | _JOB_TYPE_MAX, | |||
_JOB_TYPE_INVALID = -1 | _JOB_TYPE_INVALID = -1 | |||
}; | }; | |||
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 | |||
skipping to change at line 87 | skipping to change at line 104 | |||
JOB_DONE, | JOB_DONE, | |||
JOB_CANCELED, | JOB_CANCELED, | |||
JOB_TIMEOUT, | JOB_TIMEOUT, | |||
JOB_FAILED, | JOB_FAILED, | |||
JOB_DEPENDENCY, | JOB_DEPENDENCY, | |||
JOB_SKIPPED, | JOB_SKIPPED, | |||
_JOB_RESULT_MAX, | _JOB_RESULT_MAX, | |||
_JOB_RESULT_INVALID = -1 | _JOB_RESULT_INVALID = -1 | |||
}; | }; | |||
#include "manager.h" | ||||
#include "unit.h" | ||||
#include "hashmap.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); | |||
skipping to change at line 122 | skipping to change at line 151 | |||
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; | Watch timer_watch; | |||
/* Note that this bus object is not ref counted here. */ | /* There can be more than one client, because of job merging. */ | |||
DBusConnection *bus; | LIST_HEAD(JobBusClient, bus_client_list); | |||
char *bus_client; | ||||
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; | ||||
}; | }; | |||
Job* job_new(Manager *m, JobType type, Unit *unit); | JobBusClient* job_bus_client_new(DBusConnection *connection, const char *na | |||
me); | ||||
Job* job_new(Unit *unit, JobType type); | ||||
Job* job_new_raw(Unit *unit); | ||||
void job_free(Job *job); | void job_free(Job *job); | |||
Job* job_install(Job *j); | ||||
int job_install_deserialized(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_deserialize(Job *j, FILE *f, FDSet *fds); | ||||
int job_coldplug(Job *j); | ||||
JobDependency* job_dependency_new(Job *subject, Job *object, bool matters, bool conflicts); | JobDependency* job_dependency_new(Job *subject, Job *object, bool matters, bool conflicts); | |||
void job_dependency_free(JobDependency *l); | void job_dependency_free(JobDependency *l); | |||
bool job_is_anchor(Job *j); | ||||
int job_merge(Job *j, Job *other); | int job_merge(Job *j, Job *other); | |||
int job_type_merge(JobType *a, JobType b); | JobType job_type_lookup_merge(JobType a, JobType b); | |||
bool job_type_is_mergeable(JobType a, JobType b); | ||||
bool job_type_is_superset(JobType a, JobType b); | static inline bool job_type_is_mergeable(JobType a, JobType b) { | |||
bool job_type_is_conflicting(JobType a, JobType b); | return job_type_lookup_merge(a, b) >= 0; | |||
} | ||||
static inline bool job_type_is_conflicting(JobType a, JobType b) { | ||||
return !job_type_is_mergeable(a, b); | ||||
} | ||||
static inline bool job_type_is_superset(JobType a, JobType b) { | ||||
/* Checks whether operation a is a "superset" of b in its actions * | ||||
/ | ||||
return a == job_type_lookup_merge(a, b); | ||||
} | ||||
bool job_type_is_redundant(JobType a, UnitActiveState b); | bool job_type_is_redundant(JobType a, UnitActiveState b); | |||
/* 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. */ | ||||
void job_type_collapse(JobType *t, Unit *u); | ||||
int job_type_merge_and_collapse(JobType *a, JobType b, Unit *u); | ||||
bool job_is_runnable(Job *j); | 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); | 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); | int job_finish_and_invalidate(Job *j, JobResult result, bool recursive); | |||
char *job_dbus_path(Job *j); | char *job_dbus_path(Job *j); | |||
const char* job_type_to_string(JobType t); | const char* job_type_to_string(JobType t); | |||
JobType job_type_from_string(const char *s); | JobType job_type_from_string(const char *s); | |||
const char* job_state_to_string(JobState t); | const char* job_state_to_string(JobState t); | |||
JobState job_state_from_string(const char *s); | JobState job_state_from_string(const char *s); | |||
const char* job_mode_to_string(JobMode t); | const char* job_mode_to_string(JobMode t); | |||
JobMode job_mode_from_string(const char *s); | JobMode job_mode_from_string(const char *s); | |||
const char* job_result_to_string(JobResult t); | const char* job_result_to_string(JobResult t); | |||
JobResult job_result_from_string(const char *s); | JobResult job_result_from_string(const char *s); | |||
#endif | ||||
End of changes. 21 change blocks. | ||||
28 lines changed or deleted | 88 lines changed or added | |||
journal-def.h | journal-def.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foojournaldefhfoo | #pragma once | |||
#define foojournaldefhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 "sparse-endian.h" | |||
#include <systemd/sd-id128.h> | #include <systemd/sd-id128.h> | |||
#include "macro.h" | #include "macro.h" | |||
typedef struct Header Header; | typedef struct Header Header; | |||
typedef struct ObjectHeader ObjectHeader; | typedef struct ObjectHeader ObjectHeader; | |||
typedef union Object Object; | typedef union Object Object; | |||
typedef struct DataObject DataObject; | typedef struct DataObject DataObject; | |||
typedef struct FieldObject FieldObject; | typedef struct FieldObject FieldObject; | |||
typedef struct EntryObject EntryObject; | typedef struct EntryObject EntryObject; | |||
typedef struct HashTableObject HashTableObject; | typedef struct HashTableObject HashTableObject; | |||
typedef struct EntryArrayObject EntryArrayObject; | typedef struct EntryArrayObject EntryArrayObject; | |||
typedef struct SignatureObject SignatureObject; | ||||
typedef struct EntryItem EntryItem; | typedef struct EntryItem EntryItem; | |||
typedef struct HashItem HashItem; | typedef struct HashItem HashItem; | |||
/* Object types */ | /* Object types */ | |||
enum { | enum { | |||
OBJECT_UNUSED, | OBJECT_UNUSED, | |||
OBJECT_DATA, | OBJECT_DATA, | |||
OBJECT_FIELD, | OBJECT_FIELD, | |||
OBJECT_ENTRY, | OBJECT_ENTRY, | |||
OBJECT_DATA_HASH_TABLE, | OBJECT_DATA_HASH_TABLE, | |||
OBJECT_FIELD_HASH_TABLE, | OBJECT_FIELD_HASH_TABLE, | |||
OBJECT_ENTRY_ARRAY, | OBJECT_ENTRY_ARRAY, | |||
OBJECT_SIGNATURE, | ||||
_OBJECT_TYPE_MAX | _OBJECT_TYPE_MAX | |||
}; | }; | |||
/* Object flags */ | /* Object flags */ | |||
enum { | enum { | |||
OBJECT_COMPRESSED = 1 | OBJECT_COMPRESSED = 1 | |||
}; | }; | |||
_packed_ struct ObjectHeader { | _packed_ struct ObjectHeader { | |||
uint8_t type; | uint8_t type; | |||
uint8_t flags; | uint8_t flags; | |||
uint8_t reserved[6]; | uint8_t reserved[6]; | |||
uint64_t size; | le64_t size; | |||
uint8_t payload[]; | uint8_t payload[]; | |||
}; | }; | |||
_packed_ struct DataObject { | _packed_ struct DataObject { | |||
ObjectHeader object; | ObjectHeader object; | |||
uint64_t hash; | le64_t hash; | |||
uint64_t next_hash_offset; | le64_t next_hash_offset; | |||
uint64_t next_field_offset; | le64_t next_field_offset; | |||
uint64_t entry_offset; /* the first array entry we store inline */ | le64_t entry_offset; /* the first array entry we store inline */ | |||
uint64_t entry_array_offset; | le64_t entry_array_offset; | |||
uint64_t n_entries; | le64_t n_entries; | |||
uint8_t payload[]; | uint8_t payload[]; | |||
}; | }; | |||
_packed_ struct FieldObject { | _packed_ struct FieldObject { | |||
ObjectHeader object; | ObjectHeader object; | |||
uint64_t hash; | le64_t hash; | |||
uint64_t next_hash_offset; | le64_t next_hash_offset; | |||
uint64_t head_data_offset; | le64_t head_data_offset; | |||
uint64_t tail_data_offset; | le64_t tail_data_offset; | |||
uint8_t payload[]; | uint8_t payload[]; | |||
}; | }; | |||
_packed_ struct EntryItem { | _packed_ struct EntryItem { | |||
uint64_t object_offset; | le64_t object_offset; | |||
uint64_t hash; | le64_t hash; | |||
}; | }; | |||
_packed_ struct EntryObject { | _packed_ struct EntryObject { | |||
ObjectHeader object; | ObjectHeader object; | |||
uint64_t seqnum; | le64_t seqnum; | |||
uint64_t realtime; | le64_t realtime; | |||
uint64_t monotonic; | le64_t monotonic; | |||
sd_id128_t boot_id; | sd_id128_t boot_id; | |||
uint64_t xor_hash; | le64_t xor_hash; | |||
EntryItem items[]; | EntryItem items[]; | |||
}; | }; | |||
_packed_ struct HashItem { | _packed_ struct HashItem { | |||
uint64_t head_hash_offset; | le64_t head_hash_offset; | |||
uint64_t tail_hash_offset; | le64_t tail_hash_offset; | |||
}; | }; | |||
_packed_ struct HashTableObject { | _packed_ struct HashTableObject { | |||
ObjectHeader object; | ObjectHeader object; | |||
HashItem items[]; | HashItem items[]; | |||
}; | }; | |||
_packed_ struct EntryArrayObject { | _packed_ struct EntryArrayObject { | |||
ObjectHeader object; | ObjectHeader object; | |||
uint64_t next_entry_array_offset; | le64_t next_entry_array_offset; | |||
uint64_t items[]; | le64_t items[]; | |||
}; | ||||
#define SIGNATURE_LENGTH 160 | ||||
_packed_ struct SignatureObject { | ||||
ObjectHeader object; | ||||
le64_t from; | ||||
uint8_t signature[SIGNATURE_LENGTH]; | ||||
}; | }; | |||
union Object { | union Object { | |||
ObjectHeader object; | ObjectHeader object; | |||
DataObject data; | DataObject data; | |||
FieldObject field; | FieldObject field; | |||
EntryObject entry; | EntryObject entry; | |||
HashTableObject hash_table; | HashTableObject hash_table; | |||
EntryArrayObject entry_array; | EntryArrayObject entry_array; | |||
SignatureObject signature; | ||||
}; | }; | |||
enum { | enum { | |||
STATE_OFFLINE, | STATE_OFFLINE, | |||
STATE_ONLINE, | STATE_ONLINE, | |||
STATE_ARCHIVED | STATE_ARCHIVED | |||
}; | }; | |||
/* Header flags */ | /* Header flags */ | |||
enum { | enum { | |||
HEADER_INCOMPATIBLE_COMPRESSED = 1 | HEADER_INCOMPATIBLE_COMPRESSED = 1 | |||
}; | }; | |||
enum { | ||||
HEADER_COMPATIBLE_SIGNED = 1 | ||||
}; | ||||
_packed_ struct Header { | _packed_ struct Header { | |||
uint8_t signature[8]; /* "LPKSHHRH" */ | uint8_t signature[8]; /* "LPKSHHRH" */ | |||
uint32_t compatible_flags; | uint32_t compatible_flags; | |||
uint32_t incompatible_flags; | uint32_t incompatible_flags; | |||
uint8_t state; | uint8_t state; | |||
uint8_t reserved[7]; | uint8_t reserved[7]; | |||
sd_id128_t file_id; | sd_id128_t file_id; | |||
sd_id128_t machine_id; | sd_id128_t machine_id; /* last writer */ | |||
sd_id128_t boot_id; | sd_id128_t boot_id; /* last writer */ | |||
sd_id128_t seqnum_id; | sd_id128_t seqnum_id; | |||
uint64_t arena_offset; | le64_t header_size; | |||
uint64_t arena_size; | le64_t arena_size; | |||
uint64_t data_hash_table_offset; /* for looking up data objects | le64_t data_hash_table_offset; /* for looking up data objects * | |||
*/ | / | |||
uint64_t data_hash_table_size; | le64_t data_hash_table_size; | |||
uint64_t field_hash_table_offset; /* for looking up field objec | le64_t field_hash_table_offset; /* for looking up field objects | |||
ts */ | */ | |||
uint64_t field_hash_table_size; | le64_t field_hash_table_size; | |||
uint64_t tail_object_offset; | le64_t tail_object_offset; | |||
uint64_t n_objects; | le64_t n_objects; | |||
uint64_t n_entries; | le64_t n_entries; | |||
uint64_t seqnum; | le64_t tail_seqnum; | |||
uint64_t first_seqnum; | le64_t head_seqnum; | |||
uint64_t entry_array_offset; | le64_t entry_array_offset; | |||
uint64_t head_entry_realtime; | le64_t head_entry_realtime; | |||
uint64_t tail_entry_realtime; | le64_t tail_entry_realtime; | |||
uint64_t tail_entry_monotonic; | le64_t tail_entry_monotonic; | |||
/* Added in 187 */ | ||||
le64_t n_data; | ||||
le64_t n_fields; | ||||
}; | }; | |||
#endif | ||||
End of changes. 22 change blocks. | ||||
47 lines changed or deleted | 67 lines changed or added | |||
journal-file.h | journal-file.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foojournalfilehfoo | #pragma once | |||
#define foojournalfilehfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <systemd/sd-id128.h> | #include <systemd/sd-id128.h> | |||
#include "sparse-endian.h" | ||||
#include "journal-def.h" | #include "journal-def.h" | |||
#include "util.h" | #include "util.h" | |||
typedef struct Window { | typedef struct Window { | |||
void *ptr; | void *ptr; | |||
uint64_t offset; | uint64_t offset; | |||
uint64_t size; | uint64_t size; | |||
} Window; | } Window; | |||
enum { | enum { | |||
WINDOW_UNKNOWN = OBJECT_UNUSED, | WINDOW_UNKNOWN = OBJECT_UNUSED, | |||
WINDOW_DATA = OBJECT_DATA, | WINDOW_DATA = OBJECT_DATA, | |||
WINDOW_ENTRY = OBJECT_ENTRY, | WINDOW_ENTRY = OBJECT_ENTRY, | |||
WINDOW_DATA_HASH_TABLE = OBJECT_DATA_HASH_TABLE, | WINDOW_DATA_HASH_TABLE = OBJECT_DATA_HASH_TABLE, | |||
WINDOW_FIELD_HASH_TABLE = OBJECT_FIELD_HASH_TABLE, | WINDOW_FIELD_HASH_TABLE = OBJECT_FIELD_HASH_TABLE, | |||
WINDOW_ENTRY_ARRAY = OBJECT_ENTRY_ARRAY, | WINDOW_ENTRY_ARRAY = OBJECT_ENTRY_ARRAY, | |||
WINDOW_SIGNATURE = OBJECT_SIGNATURE, | ||||
WINDOW_HEADER, | WINDOW_HEADER, | |||
_WINDOW_MAX | _WINDOW_MAX | |||
}; | }; | |||
typedef struct JournalMetrics { | typedef struct JournalMetrics { | |||
uint64_t max_use; | uint64_t max_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; | |||
skipping to change at line 89 | skipping to change at line 90 | |||
void *compress_buffer; | void *compress_buffer; | |||
uint64_t compress_buffer_size; | uint64_t compress_buffer_size; | |||
#endif | #endif | |||
} JournalFile; | } JournalFile; | |||
typedef enum direction { | typedef enum direction { | |||
DIRECTION_UP, | DIRECTION_UP, | |||
DIRECTION_DOWN | DIRECTION_DOWN | |||
} direction_t; | } direction_t; | |||
int journal_file_open(const char *fname, int flags, mode_t mode, JournalFil | int journal_file_open( | |||
e *template, JournalFile **ret); | const char *fname, | |||
int flags, | ||||
mode_t mode, | ||||
JournalMetrics *metrics, | ||||
JournalFile *template, | ||||
JournalFile **ret); | ||||
void journal_file_close(JournalFile *j); | void journal_file_close(JournalFile *j); | |||
int journal_file_open_reliably(const char *fname, int flags, mode_t mode, J | int journal_file_open_reliably( | |||
ournalFile *template, JournalFile **ret); | const char *fname, | |||
int flags, | ||||
mode_t mode, | ||||
JournalMetrics *metrics, | ||||
JournalFile *template, | ||||
JournalFile **ret); | ||||
int journal_file_move_to_object(JournalFile *f, int type, uint64_t offset, Object **ret); | int journal_file_move_to_object(JournalFile *f, int type, uint64_t offset, Object **ret); | |||
uint64_t journal_file_entry_n_items(Object *o); | uint64_t journal_file_entry_n_items(Object *o); | |||
int journal_file_append_entry(JournalFile *f, const dual_timestamp *ts, con st struct iovec iovec[], unsigned n_iovec, uint64_t *seqno, Object **ret, u int64_t *offset); | int journal_file_append_entry(JournalFile *f, const dual_timestamp *ts, con st struct iovec iovec[], unsigned n_iovec, uint64_t *seqno, Object **ret, u int64_t *offset); | |||
int journal_file_find_data_object(JournalFile *f, const void *data, uint64_ t size, Object **ret, uint64_t *offset); | int journal_file_find_data_object(JournalFile *f, const void *data, uint64_ t size, Object **ret, uint64_t *offset); | |||
int journal_file_find_data_object_with_hash(JournalFile *f, const void *dat a, uint64_t size, uint64_t hash, Object **ret, uint64_t *offset); | int journal_file_find_data_object_with_hash(JournalFile *f, const void *dat a, uint64_t size, uint64_t hash, Object **ret, uint64_t *offset); | |||
int journal_file_next_entry(JournalFile *f, Object *o, uint64_t p, directio n_t direction, Object **ret, uint64_t *offset); | int journal_file_next_entry(JournalFile *f, Object *o, uint64_t p, directio n_t direction, Object **ret, uint64_t *offset); | |||
int journal_file_skip_entry(JournalFile *f, Object *o, uint64_t p, int64_t skip, Object **ret, uint64_t *offset); | int journal_file_skip_entry(JournalFile *f, Object *o, uint64_t p, int64_t skip, Object **ret, uint64_t *offset); | |||
int journal_file_next_entry_for_data(JournalFile *f, Object *o, uint64_t p, uint64_t data_offset, direction_t direction, Object **ret, uint64_t *offse t); | int journal_file_next_entry_for_data(JournalFile *f, Object *o, uint64_t p, uint64_t data_offset, direction_t direction, Object **ret, uint64_t *offse t); | |||
int journal_file_move_to_entry_by_offset(JournalFile *f, uint64_t seqnum, d irection_t direction, Object **ret, uint64_t *offset); | ||||
int journal_file_move_to_entry_by_seqnum(JournalFile *f, uint64_t seqnum, d irection_t direction, Object **ret, uint64_t *offset); | int journal_file_move_to_entry_by_seqnum(JournalFile *f, uint64_t seqnum, d irection_t direction, Object **ret, uint64_t *offset); | |||
int journal_file_move_to_entry_by_realtime(JournalFile *f, uint64_t realtim e, direction_t direction, Object **ret, uint64_t *offset); | int journal_file_move_to_entry_by_realtime(JournalFile *f, uint64_t realtim e, direction_t direction, Object **ret, uint64_t *offset); | |||
int journal_file_move_to_entry_by_monotonic(JournalFile *f, sd_id128_t boot _id, uint64_t monotonic, direction_t direction, Object **ret, uint64_t *off set); | int journal_file_move_to_entry_by_monotonic(JournalFile *f, sd_id128_t boot _id, uint64_t monotonic, direction_t direction, Object **ret, uint64_t *off set); | |||
int journal_file_move_to_entry_by_offset_for_data(JournalFile *f, uint64_t data_offset, uint64_t p, direction_t direction, Object **ret, uint64_t *off set); | ||||
int journal_file_move_to_entry_by_seqnum_for_data(JournalFile *f, uint64_t data_offset, uint64_t seqnum, direction_t direction, Object **ret, uint64_t *offset); | int journal_file_move_to_entry_by_seqnum_for_data(JournalFile *f, uint64_t data_offset, uint64_t seqnum, direction_t direction, Object **ret, uint64_t *offset); | |||
int journal_file_move_to_entry_by_realtime_for_data(JournalFile *f, uint64_ t data_offset, uint64_t realtime, direction_t direction, Object **ret, uint 64_t *offset); | int journal_file_move_to_entry_by_realtime_for_data(JournalFile *f, uint64_ t data_offset, uint64_t realtime, direction_t direction, Object **ret, uint 64_t *offset); | |||
int journal_file_move_to_entry_by_monotonic_for_data(JournalFile *f, uint64 _t data_offset, sd_id128_t boot_id, uint64_t monotonic, direction_t directi on, Object **ret, uint64_t *offset); | ||||
int journal_file_copy_entry(JournalFile *from, JournalFile *to, Object *o, uint64_t p, uint64_t *seqnum, Object **ret, uint64_t *offset); | int journal_file_copy_entry(JournalFile *from, JournalFile *to, Object *o, uint64_t p, uint64_t *seqnum, Object **ret, uint64_t *offset); | |||
void journal_file_dump(JournalFile *f); | void journal_file_dump(JournalFile *f); | |||
void journal_file_print_header(JournalFile *f); | ||||
int journal_file_rotate(JournalFile **f); | int journal_file_rotate(JournalFile **f); | |||
int journal_directory_vacuum(const char *directory, uint64_t max_use, uint6 4_t min_free); | int journal_directory_vacuum(const char *directory, uint64_t max_use, uint6 4_t min_free); | |||
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); | |||
#endif | 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); | ||||
bool journal_file_rotate_suggested(JournalFile *f); | ||||
End of changes. 13 change blocks. | ||||
10 lines changed or deleted | 26 lines changed or added | |||
journal-internal.h | journal-internal.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foojournalinternalhfoo | #pragma once | |||
#define foojournalinternalhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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> | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <systemd/sd-id128.h> | #include <systemd/sd-id128.h> | |||
#include "journal-def.h" | ||||
#include "list.h" | #include "list.h" | |||
#include "hashmap.h" | ||||
#include "journal-file.h" | ||||
typedef struct Match Match; | typedef struct Match Match; | |||
typedef struct Location Location; | ||||
typedef struct Directory Directory; | ||||
typedef enum MatchType { | ||||
MATCH_DISCRETE, | ||||
MATCH_OR_TERM, | ||||
MATCH_AND_TERM | ||||
} MatchType; | ||||
struct Match { | struct Match { | |||
MatchType type; | ||||
Match *parent; | ||||
LIST_FIELDS(Match, matches); | ||||
/* For concrete matches */ | ||||
char *data; | char *data; | |||
size_t size; | size_t size; | |||
uint64_t le_hash; | le64_t le_hash; | |||
LIST_FIELDS(Match, matches); | /* For terms */ | |||
LIST_HEAD(Match, matches); | ||||
}; | }; | |||
typedef enum location_type { | typedef enum LocationType { | |||
LOCATION_HEAD, | LOCATION_HEAD, | |||
LOCATION_TAIL, | LOCATION_TAIL, | |||
LOCATION_DISCRETE | LOCATION_DISCRETE | |||
} location_type_t; | } LocationType; | |||
typedef struct Location { | struct Location { | |||
location_type_t type; | LocationType type; | |||
uint64_t seqnum; | uint64_t seqnum; | |||
sd_id128_t seqnum_id; | sd_id128_t seqnum_id; | |||
bool seqnum_set; | bool seqnum_set; | |||
uint64_t realtime; | uint64_t realtime; | |||
bool realtime_set; | bool realtime_set; | |||
uint64_t monotonic; | uint64_t monotonic; | |||
sd_id128_t boot_id; | sd_id128_t boot_id; | |||
bool monotonic_set; | bool monotonic_set; | |||
uint64_t xor_hash; | uint64_t xor_hash; | |||
bool xor_hash_set; | bool xor_hash_set; | |||
} Location; | }; | |||
struct Directory { | ||||
char *path; | ||||
int wd; | ||||
bool is_root; | ||||
}; | ||||
struct sd_journal { | struct sd_journal { | |||
int flags; | int flags; | |||
char *path; | ||||
Hashmap *files; | Hashmap *files; | |||
Location current_location; | Location current_location; | |||
JournalFile *current_file; | JournalFile *current_file; | |||
uint64_t current_field; | uint64_t current_field; | |||
Hashmap *directories_by_path; | ||||
Hashmap *directories_by_wd; | ||||
int inotify_fd; | int inotify_fd; | |||
Hashmap *inotify_wd_dirs; | ||||
Hashmap *inotify_wd_roots; | ||||
LIST_HEAD(Match, matches); | Match *level0, *level1; | |||
unsigned n_matches; | ||||
unsigned current_invalidate_counter, last_invalidate_counter; | ||||
}; | }; | |||
#endif | char *journal_make_match_string(sd_journal *j); | |||
void journal_print_header(sd_journal *j); | ||||
End of changes. 20 change blocks. | ||||
17 lines changed or deleted | 44 lines changed or added | |||
journal-rate-limit.h | journal-rate-limit.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foojournalratelimithfoo | #pragma once | |||
#define foojournalratelimithfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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" | |||
#include "util.h" | #include "util.h" | |||
typedef struct JournalRateLimit JournalRateLimit; | typedef struct JournalRateLimit JournalRateLimit; | |||
JournalRateLimit *journal_rate_limit_new(usec_t interval, unsigned burst); | JournalRateLimit *journal_rate_limit_new(usec_t interval, unsigned burst); | |||
void journal_rate_limit_free(JournalRateLimit *r); | void journal_rate_limit_free(JournalRateLimit *r); | |||
int journal_rate_limit_test(JournalRateLimit *r, const char *id, int priori ty, uint64_t available); | int journal_rate_limit_test(JournalRateLimit *r, const char *id, int priori ty, uint64_t available); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
journald.h | journald.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foojournaldhfoo | #pragma once | |||
#define foojournaldhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <stdbool.h> | #include <stdbool.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 "journal-rate-limit.h" | #include "journal-rate-limit.h" | |||
#include "list.h" | #include "list.h" | |||
typedef enum Storage { | ||||
STORAGE_AUTO, | ||||
STORAGE_VOLATILE, | ||||
STORAGE_PERSISTENT, | ||||
STORAGE_NONE, | ||||
_STORAGE_MAX, | ||||
_STORAGE_INVALID = -1 | ||||
} Storage; | ||||
typedef struct StdoutStream StdoutStream; | typedef struct StdoutStream StdoutStream; | |||
typedef struct Server { | typedef struct Server { | |||
int epoll_fd; | int epoll_fd; | |||
int signal_fd; | int signal_fd; | |||
int syslog_fd; | int syslog_fd; | |||
int native_fd; | int native_fd; | |||
int stdout_fd; | int stdout_fd; | |||
int proc_kmsg_fd; | int proc_kmsg_fd; | |||
skipping to change at line 81 | skipping to change at line 90 | |||
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; | |||
gid_t file_gid; | gid_t file_gid; | |||
bool file_gid_valid; | bool file_gid_valid; | |||
LIST_HEAD(StdoutStream, stdout_streams); | LIST_HEAD(StdoutStream, stdout_streams); | |||
unsigned n_stdout_streams; | unsigned n_stdout_streams; | |||
char *tty_path; | ||||
int max_level_store; | ||||
int max_level_syslog; | ||||
int max_level_kmsg; | ||||
int max_level_console; | ||||
Storage storage; | ||||
} Server; | } Server; | |||
/* 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); | |||
#endif | int config_parse_storage(const char *filename, unsigned line, const char *s | |||
ection, const char *lvalue, int ltype, const char *rvalue, void *data, void | ||||
*userdata); | ||||
const char *storage_to_string(Storage s); | ||||
Storage storage_from_string(const char *s); | ||||
End of changes. 8 change blocks. | ||||
6 lines changed or deleted | 24 lines changed or added | |||
kmod-setup.h | kmod-setup.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fookmodsetuphfoo | #pragma once | |||
#define fookmodsetuphfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 kmod_setup(void); | int kmod_setup(void); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
label.h | label.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foolabelhfoo | #pragma once | |||
#define foolabelhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <stdbool.h> | #include <stdbool.h> | |||
#include <sys/socket.h> | #include <sys/socket.h> | |||
int label_init(void); | int label_init(const char *prefix); | |||
void label_finish(void); | void label_finish(void); | |||
int label_fix(const char *path, bool ignore_enoent); | int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs); | |||
int label_socket_set(const char *label); | int label_socket_set(const char *label); | |||
void label_socket_clear(void); | void label_socket_clear(void); | |||
int label_fifofile_set(const char *path); | int label_context_set(const char *path, mode_t mode); | |||
int label_symlinkfile_set(const char *path); | void label_context_clear(void); | |||
void label_file_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, bool apply); | |||
void label_retest_selinux(void); | 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); | |||
#endif | ||||
End of changes. 9 change blocks. | ||||
12 lines changed or deleted | 10 lines changed or added | |||
list.h | list.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foolisthfoo | #pragma once | |||
#define foolisthfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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/>. | |||
***/ | ***/ | |||
/* 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) \ | |||
skipping to change at line 127 | skipping to change at line 126 | |||
for ((i) = (head); (i); (i) = (i)->name##_next) | for ((i) = (head); (i); (i) = (i)->name##_next) | |||
#define LIST_FOREACH_SAFE(name,i,n,head) \ | #define LIST_FOREACH_SAFE(name,i,n,head) \ | |||
for ((i) = (head); (i) && (((n) = (i)->name##_next), 1); (i) = (n)) | for ((i) = (head); (i) && (((n) = (i)->name##_next), 1); (i) = (n)) | |||
#define LIST_FOREACH_BEFORE(name,i,p) \ | #define LIST_FOREACH_BEFORE(name,i,p) \ | |||
for ((i) = (p)->name##_prev; (i); (i) = (i)->name##_prev) | for ((i) = (p)->name##_prev; (i); (i) = (i)->name##_prev) | |||
#define LIST_FOREACH_AFTER(name,i,p) \ | #define LIST_FOREACH_AFTER(name,i,p) \ | |||
for ((i) = (p)->name##_next; (i); (i) = (i)->name##_next) | for ((i) = (p)->name##_next; (i); (i) = (i)->name##_next) | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
load-dropin.h | load-dropin.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooloaddropinhfoo | #pragma once | |||
#define fooloaddropinhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 "unit.h" | #include "unit.h" | |||
/* Read service data supplementary drop-in directories */ | /* Read service data supplementary drop-in directories */ | |||
int unit_load_dropin(Unit *u); | int unit_load_dropin(Unit *u); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
load-fragment.h | load-fragment.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooloadfragmenthfoo | #pragma once | |||
#define fooloadfragmenthfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 "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 *filename, unsigned line, const cha r *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_warn_compat(const char *filename, unsigned line, const cha r *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_deps(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, vo id *userdata); | int config_parse_unit_deps(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, vo id *userdata); | |||
int config_parse_unit_names(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, v oid *userdata); | ||||
int config_parse_unit_string_printf(const char *filename, unsigned line, co nst char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_unit_string_printf(const char *filename, unsigned line, co nst char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_strv_printf(const char *filename, unsigned line, cons t char *section, const char *lvalue, int ltype, const char *rvalue, void *d ata, void *userdata); | int config_parse_unit_strv_printf(const char *filename, unsigned line, cons t char *section, const char *lvalue, int ltype, const char *rvalue, void *d ata, void *userdata); | |||
int config_parse_unit_path_printf(const char *filename, unsigned line, cons t char *section, const char *lvalue, int ltype, const char *rvalue, void *d ata, void *userdata); | int config_parse_unit_path_printf(const char *filename, unsigned line, cons t char *section, const char *lvalue, int ltype, const char *rvalue, void *d ata, void *userdata); | |||
int config_parse_documentation(const char *filename, unsigned line, const c har *section, const char *lvalue, int ltype, const char *rvalue, void *data , void *userdata); | ||||
int config_parse_socket_listen(const char *filename, unsigned line, const c har *section, const char *lvalue, int ltype, const char *rvalue, void *data , void *userdata); | int config_parse_socket_listen(const char *filename, unsigned line, const c har *section, const char *lvalue, int ltype, const char *rvalue, void *data , void *userdata); | |||
int config_parse_socket_bind(const char *filename, unsigned line, const cha r *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_socket_bind(const char *filename, unsigned line, const cha r *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_exec_nice(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, vo id *userdata); | int config_parse_exec_nice(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, vo id *userdata); | |||
int config_parse_exec_oom_score_adjust(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, vo id *data, void *userdata); | int config_parse_exec_oom_score_adjust(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, vo id *data, void *userdata); | |||
int config_parse_exec(const char *filename, unsigned line, const char *sect ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u serdata); | int config_parse_exec(const char *filename, unsigned line, const char *sect ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u serdata); | |||
int config_parse_service_timeout(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *da ta, void *userdata); | ||||
int config_parse_service_type(const char *filename, unsigned line, const ch ar *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_service_type(const char *filename, unsigned line, const ch ar *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_service_restart(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *da ta, void *userdata); | int config_parse_service_restart(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *da ta, void *userdata); | |||
int config_parse_socket_bindtodevice(const char *filename, unsigned line, c onst char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_socket_bindtodevice(const char *filename, unsigned line, c onst char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_output(const char *filename, unsigned line, const char *se ction, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_output(const char *filename, unsigned line, const char *se ction, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_input(const char *filename, unsigned line, const char *sec tion, const char *lvalue, int ltype, const char *rvalue, void *data, void * userdata); | int config_parse_input(const char *filename, unsigned line, const char *sec tion, const char *lvalue, int ltype, const char *rvalue, void *data, void * userdata); | |||
int config_parse_facility(const char *filename, unsigned line, const char * | ||||
section, const char *lvalue, int ltype, const char *rvalue, void *data, voi | ||||
d *userdata); | ||||
int config_parse_level(const char *filename, unsigned line, const char *sec | ||||
tion, const char *lvalue, int ltype, const char *rvalue, void *data, void * | ||||
userdata); | ||||
int config_parse_exec_io_class(const char *filename, unsigned line, const c har *section, const char *lvalue, int ltype, const char *rvalue, void *data , void *userdata); | int config_parse_exec_io_class(const char *filename, unsigned line, const c har *section, const char *lvalue, int ltype, const char *rvalue, void *data , void *userdata); | |||
int config_parse_exec_io_priority(const char *filename, unsigned line, cons t char *section, const char *lvalue, int ltype, const char *rvalue, void *d ata, void *userdata); | int config_parse_exec_io_priority(const char *filename, unsigned line, cons t char *section, const char *lvalue, int ltype, const char *rvalue, void *d ata, void *userdata); | |||
int config_parse_exec_cpu_sched_policy(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, vo id *data, void *userdata); | int config_parse_exec_cpu_sched_policy(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, vo id *data, void *userdata); | |||
int config_parse_exec_cpu_sched_prio(const char *filename, unsigned line, c onst char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_exec_cpu_sched_prio(const char *filename, unsigned line, c onst char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_exec_cpu_affinity(const char *filename, unsigned line, con st char *section, const char *lvalue, int ltype, const char *rvalue, void * data, void *userdata); | int config_parse_exec_cpu_affinity(const char *filename, unsigned line, con st char *section, const char *lvalue, int ltype, const char *rvalue, void * data, void *userdata); | |||
int config_parse_exec_capabilities(const char *filename, unsigned line, con st char *section, const char *lvalue, int ltype, const char *rvalue, void * data, void *userdata); | int config_parse_exec_capabilities(const char *filename, unsigned line, con st char *section, const char *lvalue, int ltype, const char *rvalue, void * data, void *userdata); | |||
int config_parse_exec_secure_bits(const char *filename, unsigned line, cons t char *section, const char *lvalue, int ltype, const char *rvalue, void *d ata, void *userdata); | int config_parse_exec_secure_bits(const char *filename, unsigned line, cons t char *section, const char *lvalue, int ltype, const char *rvalue, void *d ata, void *userdata); | |||
int config_parse_exec_bounding_set(const char *filename, unsigned line, con | int config_parse_bounding_set(const char *filename, unsigned line, const ch | |||
st char *section, const char *lvalue, int ltype, const char *rvalue, void * | ar *section, const char *lvalue, int ltype, const char *rvalue, void *data, | |||
data, void *userdata); | void *userdata); | |||
int config_parse_exec_timer_slack_nsec(const char *filename, unsigned line, | ||||
const char *section, const char *lvalue, int ltype, const char *rvalue, vo | ||||
id *data, void *userdata); | ||||
int config_parse_limit(const char *filename, unsigned line, const char *sec tion, const char *lvalue, int ltype, const char *rvalue, void *data, void * userdata); | int config_parse_limit(const char *filename, unsigned line, const char *sec tion, const char *lvalue, int ltype, const char *rvalue, void *data, void * userdata); | |||
int config_parse_unit_cgroup(const char *filename, unsigned line, const cha r *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_unit_cgroup(const char *filename, unsigned line, const cha r *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_sysv_priority(const char *filename, unsigned line, const c har *section, const char *lvalue, int ltype, const char *rvalue, void *data , void *userdata); | int config_parse_sysv_priority(const char *filename, unsigned line, const c har *section, const char *lvalue, int ltype, const char *rvalue, void *data , void *userdata); | |||
int config_parse_fsck_passno(const char *filename, unsigned line, const cha r *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_fsck_passno(const char *filename, unsigned line, const cha r *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_kill_signal(const char *filename, unsigned line, const cha r *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_kill_signal(const char *filename, unsigned line, const cha r *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_exec_mount_flags(const char *filename, unsigned line, cons t char *section, const char *lvalue, int ltype, const char *rvalue, void *d ata, void *userdata); | int config_parse_exec_mount_flags(const char *filename, unsigned line, cons t char *section, const char *lvalue, int ltype, const char *rvalue, void *d ata, void *userdata); | |||
int config_parse_timer(const char *filename, unsigned line, const char *sec tion, const char *lvalue, int ltype, const char *rvalue, void *data, void * userdata); | int config_parse_timer(const char *filename, unsigned line, const char *sec tion, const char *lvalue, int ltype, const char *rvalue, void *data, void * userdata); | |||
int config_parse_timer_unit(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, v oid *userdata); | int config_parse_timer_unit(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, v oid *userdata); | |||
int config_parse_path_spec(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, vo id *userdata); | int config_parse_path_spec(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, vo id *userdata); | |||
int config_parse_path_unit(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, vo id *userdata); | int config_parse_path_unit(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, vo id *userdata); | |||
skipping to change at line 86 | skipping to change at line 83 | |||
int config_parse_unit_condition_null(const char *filename, unsigned line, c onst char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_unit_condition_null(const char *filename, unsigned line, c onst char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_kill_mode(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, vo id *userdata); | int config_parse_kill_mode(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, vo id *userdata); | |||
int config_parse_notify_access(const char *filename, unsigned line, const c har *section, const char *lvalue, int ltype, const char *rvalue, void *data , void *userdata); | int config_parse_notify_access(const char *filename, unsigned line, const c har *section, const char *lvalue, int ltype, const char *rvalue, void *data , void *userdata); | |||
int config_parse_start_limit_action(const char *filename, unsigned line, co nst char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_start_limit_action(const char *filename, unsigned line, co nst char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_cgroup_attr(const char *filename, unsigned line, cons t char *section, const char *lvalue, int ltype, const char *rvalue, void *d ata, void *userdata); | int config_parse_unit_cgroup_attr(const char *filename, unsigned line, cons t char *section, const char *lvalue, int ltype, const char *rvalue, void *d ata, void *userdata); | |||
int config_parse_unit_cpu_shares(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *da ta, void *userdata); | int config_parse_unit_cpu_shares(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *da ta, void *userdata); | |||
int config_parse_unit_memory_limit(const char *filename, unsigned line, con st char *section, const char *lvalue, int ltype, const char *rvalue, void * data, void *userdata); | int config_parse_unit_memory_limit(const char *filename, unsigned line, con st char *section, const char *lvalue, int ltype, const char *rvalue, void * data, void *userdata); | |||
int config_parse_unit_device_allow(const char *filename, unsigned line, con st char *section, const char *lvalue, int ltype, const char *rvalue, void * data, void *userdata); | int config_parse_unit_device_allow(const char *filename, unsigned line, con st char *section, const char *lvalue, int ltype, const char *rvalue, void * data, void *userdata); | |||
int config_parse_unit_blkio_weight(const char *filename, unsigned line, con st char *section, const char *lvalue, int ltype, const char *rvalue, void * data, void *userdata); | int config_parse_unit_blkio_weight(const char *filename, unsigned line, con st char *section, const char *lvalue, int ltype, const char *rvalue, void * data, void *userdata); | |||
int config_parse_unit_blkio_bandwidth(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, voi d *data, void *userdata); | int config_parse_unit_blkio_bandwidth(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, voi d *data, void *userdata); | |||
int config_parse_unit_requires_mounts_for(const char *filename, unsigned li | ||||
ne, const char *section, const char *lvalue, int ltype, const char *rvalue, | ||||
void *data, void *userdata); | ||||
int config_parse_syscall_filter(const char *filename, unsigned line, const | ||||
char *section, const char *lvalue, int ltype, const char *rvalue, void *dat | ||||
a, 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[]; | |||
#endif | ||||
End of changes. 11 change blocks. | ||||
19 lines changed or deleted | 16 lines changed or added | |||
locale-setup.h | locale-setup.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foolocalesetuphfoo | #pragma once | |||
#define foolocalesetuphfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 locale_setup(void); | int locale_setup(void); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
log.h | log.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foologhfoo | #pragma once | |||
#define foologhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <syslog.h> | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <stdarg.h> | #include <stdarg.h> | |||
#include "macro.h" | #include "macro.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, | |||
LOG_TARGET_SYSLOG, | LOG_TARGET_SYSLOG, | |||
LOG_TARGET_SYSLOG_OR_KMSG, | LOG_TARGET_SYSLOG_OR_KMSG, | |||
LOG_TARGET_AUTO, /* console if stderr is tty, JOURNAL_OR_KMSG other wise */ | LOG_TARGET_AUTO, /* console if stderr is tty, JOURNAL_OR_KMSG other wise */ | |||
LOG_TARGET_SAFE, /* console if stderr is tty, KMSG otherwise */ | ||||
LOG_TARGET_NULL, | LOG_TARGET_NULL, | |||
_LOG_TARGET_MAX, | _LOG_TARGET_MAX, | |||
_LOG_TARGET_INVALID = -1 | _LOG_TARGET_INVALID = -1 | |||
} 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); | ||||
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); | |||
void log_show_location(bool b); | void log_show_location(bool b); | |||
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); | |||
skipping to change at line 96 | skipping to change at line 97 | |||
_noreturn_ void log_assert_failed_unreachable(const char *text, const char *file, int line, const char *func); | _noreturn_ void log_assert_failed_unreachable(const char *text, const char *file, int line, 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); | |||
#define log_full(level, ...) log_meta(level, __FILE__, __LINE__, __func__, __VA_ARGS__) | #define log_full(level, ...) log_meta(level, __FILE__, __LINE__, __func__ , __VA_ARGS__) | |||
#define log_debug(...) log_meta(LOG_DEBUG, __FILE__, __LINE__, __func__ , __VA_ARGS__) | #define log_debug(...) log_meta(LOG_DEBUG, __FILE__, __LINE__, __func__ , __VA_ARGS__) | |||
#define log_info(...) log_meta(LOG_INFO, __FILE__, __LINE__, __func__ , __VA_ARGS__) | #define log_info(...) log_meta(LOG_INFO, __FILE__, __LINE__, __func__ , __VA_ARGS__) | |||
#define log_notice(...) log_meta(LOG_NOTICE, __FILE__, __LINE__, __func__ , __VA_ARGS__) | #define log_notice(...) log_meta(LOG_NOTICE, __FILE__, __LINE__, __func__ , __VA_ARGS__) | |||
#define log_warning(...) log_meta(LOG_WARNING, __FILE__, __LINE__, __func__ , __VA_ARGS__) | #define log_warning(...) log_meta(LOG_WARNING, __FILE__, __LINE__, __func__ , __VA_ARGS__) | |||
#define log_error(...) log_meta(LOG_ERR, __FILE__, __LINE__, __func__ , __VA_ARGS__) | #define log_error(...) log_meta(LOG_ERR, __FILE__, __LINE__, __func__ , __VA_ARGS__) | |||
/* 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) | |||
const char *log_target_to_string(LogTarget target); | const char *log_target_to_string(LogTarget target); | |||
LogTarget log_target_from_string(const char *s); | LogTarget log_target_from_string(const char *s); | |||
#endif | ||||
End of changes. 8 change blocks. | ||||
7 lines changed or deleted | 8 lines changed or added | |||
logind-acl.h | logind-acl.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foologindaclhfoo | #pragma once | |||
#define foologindaclhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <stdbool.h> | #include <stdbool.h> | |||
#include <libudev.h> | #include <libudev.h> | |||
#ifdef HAVE_ACL | #ifdef HAVE_ACL | |||
int devnode_acl(const char *path, | int devnode_acl(const char *path, | |||
skipping to change at line 59 | skipping to change at line 58 | |||
static inline int devnode_acl_all(struct udev *udev, | static inline int devnode_acl_all(struct udev *udev, | |||
const char *seat, | const char *seat, | |||
bool flush, | bool flush, | |||
bool del, uid_t old_uid, | bool del, uid_t old_uid, | |||
bool add, uid_t new_uid) { | bool add, uid_t new_uid) { | |||
return 0; | return 0; | |||
} | } | |||
#endif | #endif | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
logind-device.h | logind-device.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foologinddevicehfoo | #pragma once | |||
#define foologinddevicehfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 Device Device; | typedef struct Device Device; | |||
#include "list.h" | #include "list.h" | |||
#include "util.h" | #include "util.h" | |||
#include "logind.h" | #include "logind.h" | |||
#include "logind-seat.h" | #include "logind-seat.h" | |||
skipping to change at line 47 | skipping to change at line 46 | |||
dual_timestamp timestamp; | dual_timestamp timestamp; | |||
LIST_FIELDS(struct Device, devices); | LIST_FIELDS(struct Device, devices); | |||
}; | }; | |||
Device* device_new(Manager *m, const char *sysfs); | Device* device_new(Manager *m, const char *sysfs); | |||
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); | void device_detach(Device *d); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
logind-seat.h | logind-seat.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foologindseathfoo | #pragma once | |||
#define foologindseathfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 Seat Seat; | typedef struct Seat Seat; | |||
#include "list.h" | #include "list.h" | |||
#include "util.h" | #include "util.h" | |||
#include "logind.h" | #include "logind.h" | |||
#include "logind-device.h" | #include "logind-device.h" | |||
#include "logind-session.h" | #include "logind-session.h" | |||
skipping to change at line 66 | skipping to change at line 65 | |||
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_active_vt_changed(Seat *s, 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); | |||
bool seat_is_vtconsole(Seat *s); | bool seat_is_vtconsole(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_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); | |||
int seat_stop_sessions(Seat *s); | int seat_stop_sessions(Seat *s); | |||
int seat_check_gc(Seat *s, bool drop_not_started); | int 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); | char *seat_bus_path(Seat *s); | |||
extern const DBusObjectPathVTable bus_seat_vtable; | extern const DBusObjectPathVTable bus_seat_vtable; | |||
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); | |||
#endif | ||||
End of changes. 6 change blocks. | ||||
6 lines changed or deleted | 8 lines changed or added | |||
logind-session.h | logind-session.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foologindsessionhfoo | #pragma once | |||
#define foologindsessionhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
typedef struct Session Session; | typedef struct Session Session; | |||
#include "list.h" | #include "list.h" | |||
#include "util.h" | #include "util.h" | |||
#include "logind.h" | #include "logind.h" | |||
#include "logind-seat.h" | #include "logind-seat.h" | |||
#include "logind-user.h" | #include "logind-user.h" | |||
typedef enum SessionState { | ||||
SESSION_ONLINE, /* Logged in */ | ||||
SESSION_ACTIVE, /* Logged in and in the fg */ | ||||
SESSION_CLOSING, /* Logged out, but processes still remain */ | ||||
_SESSION_STATE_MAX, | ||||
_SESSION_STATE_INVALID = -1 | ||||
} SessionState; | ||||
typedef enum SessionType { | typedef enum SessionType { | |||
SESSION_UNSPECIFIED, | SESSION_UNSPECIFIED, | |||
SESSION_TTY, | SESSION_TTY, | |||
SESSION_X11, | SESSION_X11, | |||
_SESSION_TYPE_MAX, | _SESSION_TYPE_MAX, | |||
_SESSION_TYPE_INVALID = -1 | _SESSION_TYPE_INVALID = -1 | |||
} SessionType; | } SessionType; | |||
typedef enum SessionClass { | typedef enum SessionClass { | |||
SESSION_USER, | SESSION_USER, | |||
skipping to change at line 121 | skipping to change at line 128 | |||
int session_create_fifo(Session *s); | int session_create_fifo(Session *s); | |||
void session_remove_fifo(Session *s); | void session_remove_fifo(Session *s); | |||
int session_start(Session *s); | int session_start(Session *s); | |||
int session_stop(Session *s); | int session_stop(Session *s); | |||
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); | char *session_bus_path(Session *s); | |||
SessionState session_get_state(Session *u); | ||||
extern const DBusObjectPathVTable bus_session_vtable; | extern const DBusObjectPathVTable bus_session_vtable; | |||
int session_send_signal(Session *s, bool new_session); | int session_send_signal(Session *s, bool new_session); | |||
int session_send_changed(Session *s, const char *properties); | int session_send_changed(Session *s, const char *properties); | |||
int session_send_lock(Session *s, bool lock); | int session_send_lock(Session *s, bool lock); | |||
const char* session_state_to_string(SessionState t); | ||||
SessionState session_state_from_string(const char *s); | ||||
const char* session_type_to_string(SessionType t); | const char* session_type_to_string(SessionType t); | |||
SessionType session_type_from_string(const char *s); | SessionType session_type_from_string(const char *s); | |||
const char* session_class_to_string(SessionClass t); | const char* session_class_to_string(SessionClass t); | |||
SessionClass session_class_from_string(const char *s); | SessionClass session_class_from_string(const char *s); | |||
const char *kill_who_to_string(KillWho k); | const char *kill_who_to_string(KillWho k); | |||
KillWho kill_who_from_string(const char *s); | KillWho kill_who_from_string(const char *s); | |||
#endif | ||||
End of changes. 8 change blocks. | ||||
6 lines changed or deleted | 18 lines changed or added | |||
logind-user.h | logind-user.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foologinduserhfoo | #pragma once | |||
#define foologinduserhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 User User; | typedef struct User User; | |||
#include "list.h" | #include "list.h" | |||
#include "util.h" | #include "util.h" | |||
#include "logind.h" | #include "logind.h" | |||
#include "logind-session.h" | #include "logind-session.h" | |||
typedef enum UserState { | typedef enum UserState { | |||
USER_OFFLINE, | USER_OFFLINE, /* Not logged in at all */ | |||
USER_LINGERING, | USER_LINGERING, /* Lingering has been enabled by the admin for thi | |||
USER_ONLINE, | s user */ | |||
USER_ACTIVE, | USER_ONLINE, /* User logged in */ | |||
USER_ACTIVE, /* User logged in and has a session in the fg */ | ||||
USER_CLOSING, /* User logged out, but processes still remain and | ||||
lingering is not enabled */ | ||||
_USER_STATE_MAX, | _USER_STATE_MAX, | |||
_USER_STATE_INVALID = -1 | _USER_STATE_INVALID = -1 | |||
} UserState; | } UserState; | |||
struct User { | struct User { | |||
Manager *manager; | Manager *manager; | |||
uid_t uid; | uid_t uid; | |||
gid_t gid; | gid_t gid; | |||
char *name; | char *name; | |||
skipping to change at line 85 | skipping to change at line 85 | |||
char *user_bus_path(User *s); | char *user_bus_path(User *s); | |||
extern const DBusObjectPathVTable bus_user_vtable; | 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); | |||
const char* user_state_to_string(UserState s); | const char* user_state_to_string(UserState s); | |||
UserState user_state_from_string(const char *s); | UserState user_state_from_string(const char *s); | |||
#endif | ||||
End of changes. 6 change blocks. | ||||
10 lines changed or deleted | 12 lines changed or added | |||
logind.h | logind.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foologindhfoo | #pragma once | |||
#define foologindhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | |||
#include <libudev.h> | #include <libudev.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 "cgroup-util.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-button.h" | ||||
struct Manager { | struct Manager { | |||
DBusConnection *bus; | DBusConnection *bus; | |||
Hashmap *devices; | Hashmap *devices; | |||
Hashmap *seats; | Hashmap *seats; | |||
Hashmap *sessions; | Hashmap *sessions; | |||
Hashmap *users; | Hashmap *users; | |||
Hashmap *inhibitors; | ||||
Hashmap *buttons; | ||||
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_vcsa_monitor; | struct udev_monitor *udev_seat_monitor, *udev_vcsa_monitor, *udev_b utton_monitor; | |||
int udev_seat_fd; | int udev_seat_fd; | |||
int udev_vcsa_fd; | int udev_vcsa_fd; | |||
int udev_button_fd; | ||||
int console_active_fd; | int console_active_fd; | |||
int bus_fd; | int bus_fd; | |||
int epoll_fd; | int epoll_fd; | |||
unsigned n_autovts; | unsigned n_autovts; | |||
Seat *vtconsole; | Seat *vtconsole; | |||
char *cgroup_path; | char *cgroup_path; | |||
char **controllers, **reset_controllers; | char **controllers, **reset_controllers; | |||
char **kill_only_users, **kill_exclude_users; | char **kill_only_users, **kill_exclude_users; | |||
bool kill_user_processes; | bool kill_user_processes; | |||
unsigned long session_counter; | unsigned long session_counter; | |||
unsigned long inhibit_counter; | ||||
Hashmap *cgroups; | Hashmap *session_cgroups; | |||
Hashmap *fifo_fds; | Hashmap *user_cgroups; | |||
Hashmap *session_fds; | ||||
Hashmap *inhibitor_fds; | ||||
Hashmap *button_fds; | ||||
/* If a shutdown was delayed due to a inhibitor this contains | ||||
the unit name we are supposed to start after the delay is | ||||
over */ | ||||
const char *delayed_unit; | ||||
InhibitWhat delayed_what; | ||||
usec_t delayed_timestamp; | ||||
usec_t inhibit_delay_max; | ||||
HandleButton handle_power_key; | ||||
HandleButton handle_sleep_key; | ||||
HandleButton handle_lid_switch; | ||||
}; | }; | |||
enum { | enum { | |||
FD_SEAT_UDEV, | FD_SEAT_UDEV, | |||
FD_VCSA_UDEV, | FD_VCSA_UDEV, | |||
FD_BUTTON_UDEV, | ||||
FD_CONSOLE, | FD_CONSOLE, | |||
FD_BUS, | FD_BUS, | |||
FD_FIFO_BASE | FD_OTHER_BASE | |||
}; | }; | |||
Manager *manager_new(void); | Manager *manager_new(void); | |||
void manager_free(Manager *m); | void manager_free(Manager *m); | |||
int manager_add_device(Manager *m, const char *sysfs, Device **_device); | int manager_add_device(Manager *m, const char *sysfs, Device **_device); | |||
int manager_add_button(Manager *m, const char *name, Button **_button); | ||||
int manager_add_seat(Manager *m, const char *id, Seat **_seat); | int manager_add_seat(Manager *m, const char *id, Seat **_seat); | |||
int manager_add_session(Manager *m, User *u, const char *id, Session **_ses sion); | int manager_add_session(Manager *m, User *u, const char *id, Session **_ses sion); | |||
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_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_dispatch_seat_udev(Manager *m); | int manager_dispatch_seat_udev(Manager *m); | |||
int manager_dispatch_vcsa_udev(Manager *m); | int manager_dispatch_vcsa_udev(Manager *m); | |||
int manager_dispatch_button_udev(Manager *m); | ||||
int manager_dispatch_console(Manager *m); | int manager_dispatch_console(Manager *m); | |||
int manager_enumerate_devices(Manager *m); | int manager_enumerate_devices(Manager *m); | |||
int manager_enumerate_buttons(Manager *m); | ||||
int manager_enumerate_seats(Manager *m); | int manager_enumerate_seats(Manager *m); | |||
int manager_enumerate_sessions(Manager *m); | int manager_enumerate_sessions(Manager *m); | |||
int manager_enumerate_users(Manager *m); | int manager_enumerate_users(Manager *m); | |||
int manager_enumerate_inhibitors(Manager *m); | ||||
int manager_startup(Manager *m); | int manager_startup(Manager *m); | |||
int manager_run(Manager *m); | int manager_run(Manager *m); | |||
int manager_spawn_autovt(Manager *m, int vtnr); | int manager_spawn_autovt(Manager *m, int vtnr); | |||
void manager_cgroup_notify_empty(Manager *m, const char *cgroup); | void manager_cgroup_notify_empty(Manager *m, const char *cgroup); | |||
void manager_gc(Manager *m, bool drop_not_started); | void manager_gc(Manager *m, bool drop_not_started); | |||
int manager_get_idle_hint(Manager *m, dual_timestamp *t); | int manager_get_idle_hint(Manager *m, dual_timestamp *t); | |||
int manager_get_user_by_cgroup(Manager *m, const char *cgroup, User **user) ; | ||||
int manager_get_session_by_cgroup(Manager *m, const char *cgroup, Session * *session); | int manager_get_session_by_cgroup(Manager *m, const char *cgroup, Session * *session); | |||
int manager_get_session_by_pid(Manager *m, pid_t pid, Session **session); | int manager_get_session_by_pid(Manager *m, pid_t pid, Session **session); | |||
extern const DBusObjectPathVTable bus_manager_vtable; | extern const DBusObjectPathVTable bus_manager_vtable; | |||
DBusHandlerResult bus_message_filter(DBusConnection *c, DBusMessage *messag e, void *userdata); | DBusHandlerResult bus_message_filter(DBusConnection *c, DBusMessage *messag e, void *userdata); | |||
int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, const char *unit | ||||
_name, InhibitWhat w, DBusError *error); | ||||
int manager_send_changed(Manager *manager, const char *properties); | int manager_send_changed(Manager *manager, const char *properties); | |||
int manager_dispatch_delayed(Manager *manager); | ||||
/* 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); | |||
#endif | ||||
End of changes. 23 change blocks. | ||||
10 lines changed or deleted | 47 lines changed or added | |||
logs-show.h | logs-show.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foologsshowhfoo | #pragma once | |||
#define foologsshowhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <systemd/sd-journal.h> | #include <systemd/sd-journal.h> | |||
#include "util.h" | #include "util.h" | |||
typedef enum OutputMode { | typedef enum OutputMode { | |||
OUTPUT_SHORT, | OUTPUT_SHORT, | |||
OUTPUT_SHORT_MONOTONIC, | OUTPUT_SHORT_MONOTONIC, | |||
OUTPUT_VERBOSE, | OUTPUT_VERBOSE, | |||
OUTPUT_EXPORT, | OUTPUT_EXPORT, | |||
OUTPUT_JSON, | OUTPUT_JSON, | |||
OUTPUT_CAT, | OUTPUT_CAT, | |||
_OUTPUT_MODE_MAX, | _OUTPUT_MODE_MAX, | |||
_OUTPUT_MODE_INVALID = -1 | _OUTPUT_MODE_INVALID = -1 | |||
} OutputMode; | } OutputMode; | |||
int output_journal(sd_journal *j, OutputMode mode, unsigned line, unsigned | typedef enum OutputFlags { | |||
n_columns, bool show_all); | OUTPUT_SHOW_ALL = 1 << 0, | |||
OUTPUT_MONOTONIC_MODE = 1 << 1, | ||||
OUTPUT_FOLLOW = 1 << 2, | ||||
OUTPUT_WARN_CUTOFF = 1 << 3, | ||||
OUTPUT_FULL_WIDTH = 1 << 4, | ||||
} OutputFlags; | ||||
int output_journal(sd_journal *j, OutputMode mode, unsigned line, | ||||
unsigned n_columns, OutputFlags flags); | ||||
int show_journal_by_unit( | int show_journal_by_unit( | |||
const char *unit, | const char *unit, | |||
OutputMode mode, | OutputMode mode, | |||
unsigned n_columns, | unsigned n_columns, | |||
usec_t not_before, | usec_t not_before, | |||
unsigned how_many, | unsigned how_many, | |||
bool show_all, | OutputFlags flags); | |||
bool follow); | ||||
const char* output_mode_to_string(OutputMode m); | const char* output_mode_to_string(OutputMode m); | |||
OutputMode output_mode_from_string(const char *s); | OutputMode output_mode_from_string(const char *s); | |||
#endif | ||||
End of changes. 7 change blocks. | ||||
10 lines changed or deleted | 16 lines changed or added | |||
lookup3.h | lookup3.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foolookup3hfoo | #pragma once | |||
#define foolookup3hfoo | ||||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
uint32_t jenkins_hashword(const uint32_t *k, size_t length, uint32_t initva l); | uint32_t jenkins_hashword(const uint32_t *k, size_t length, uint32_t initva l); | |||
void jenkins_hashword2(const uint32_t *k, size_t length, uint32_t *pc, uint 32_t *pb); | void jenkins_hashword2(const uint32_t *k, size_t length, uint32_t *pc, uint 32_t *pb); | |||
uint32_t jenkins_hashlittle(const void *key, size_t length, uint32_t initva l); | uint32_t jenkins_hashlittle(const void *key, size_t length, uint32_t initva l); | |||
void jenkins_hashlittle2(const void *key, size_t length, uint32_t *pc, uint 32_t *pb); | void jenkins_hashlittle2(const void *key, size_t length, uint32_t *pc, uint 32_t *pb); | |||
uint32_t jenkins_hashbig(const void *key, size_t length, uint32_t initval); | uint32_t jenkins_hashbig(const void *key, size_t length, uint32_t initval); | |||
static inline uint64_t hash64(const void *data, size_t length) { | static inline uint64_t hash64(const void *data, size_t length) { | |||
uint32_t a = 0, b = 0; | uint32_t a = 0, b = 0; | |||
jenkins_hashlittle2(data, length, &a, &b); | jenkins_hashlittle2(data, length, &a, &b); | |||
return ((uint64_t) a << 32ULL) | (uint64_t) b; | return ((uint64_t) a << 32ULL) | (uint64_t) b; | |||
} | } | |||
#endif | ||||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added | |||
loopback-setup.h | loopback-setup.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooloopbacksetuphfoo | #pragma once | |||
#define fooloopbacksetuphfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 loopback_setup(void); | int loopback_setup(void); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
machine-id-setup.h | machine-id-setup.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foomachineidsetuphfoo | #pragma once | |||
#define foomachineidsetuphfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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(void); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
macro.h | macro.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foomacrohfoo | #pragma once | |||
#define foomacrohfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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_attr_(a,b) __attribute__ ((format (printf, a, b))) | |||
skipping to change at line 48 | skipping to change at line 47 | |||
#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 _introspect_(x) __attribute__((section("introspect." x))) | |||
#define _alignas_(x) __attribute__((aligned(__alignof(x)))) | ||||
#define XSTRINGIFY(x) #x | #define XSTRINGIFY(x) #x | |||
#define STRINGIFY(x) XSTRINGIFY(x) | #define STRINGIFY(x) XSTRINGIFY(x) | |||
/* Rounds up */ | /* Rounds up */ | |||
#define ALIGN(l) ALIGN_TO((l), sizeof(void*)) | #define ALIGN(l) ALIGN_TO((l), sizeof(void*)) | |||
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 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 | ||||
* @ptr: the pointer to the member. | ||||
* @type: the type of the container struct this is embedded in. | ||||
* @member: the name of the member within the struct. | ||||
* | ||||
*/ | ||||
#define container_of(ptr, type, member) ({ \ | ||||
const typeof( ((type *)0)->member ) *__mptr = (ptr); \ | ||||
(type *)( (char *)__mptr - offsetof(type,member) );}) | ||||
#ifndef MAX | #ifndef MAX | |||
#define MAX(a,b) \ | #define MAX(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; \ | |||
}) | }) | |||
#endif | #endif | |||
#define MAX3(a,b,c) \ | #define MAX3(a,b,c) \ | |||
skipping to change at line 180 | skipping to change at line 191 | |||
sub = MIN(i[j].iov_len, k); | sub = MIN(i[j].iov_len, k); | |||
i[j].iov_len -= sub; | i[j].iov_len -= sub; | |||
i[j].iov_base = (uint8_t*) i[j].iov_base + sub; | i[j].iov_base = (uint8_t*) i[j].iov_base + sub; | |||
k -= sub; | k -= sub; | |||
} | } | |||
return k; | return k; | |||
} | } | |||
#include "log.h" | #include "log.h" | |||
#endif | ||||
End of changes. 7 change blocks. | ||||
6 lines changed or deleted | 18 lines changed or added | |||
manager.h | manager.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foomanagerhfoo | #pragma once | |||
#define foomanagerhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#include <dbus/dbus.h> | #include <dbus/dbus.h> | |||
#include "fdset.h" | #include "fdset.h" | |||
skipping to change at line 48 | skipping to change at line 47 | |||
typedef enum ManagerExitCode { | typedef enum ManagerExitCode { | |||
MANAGER_RUNNING, | MANAGER_RUNNING, | |||
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_EXIT_CODE_MAX, | _MANAGER_EXIT_CODE_MAX, | |||
_MANAGER_EXIT_CODE_INVALID = -1 | _MANAGER_EXIT_CODE_INVALID = -1 | |||
} ManagerExitCode; | } ManagerExitCode; | |||
typedef enum ManagerRunningAs { | typedef enum ManagerRunningAs { | |||
MANAGER_SYSTEM, | MANAGER_SYSTEM, | |||
MANAGER_USER, | MANAGER_USER, | |||
_MANAGER_RUNNING_AS_MAX, | _MANAGER_RUNNING_AS_MAX, | |||
_MANAGER_RUNNING_AS_INVALID = -1 | _MANAGER_RUNNING_AS_INVALID = -1 | |||
} ManagerRunningAs; | } ManagerRunningAs; | |||
skipping to change at line 107 | skipping to change at line 107 | |||
* 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 */ | |||
/* To make it easy to iterate through the units of a specific | /* To make it easy to iterate through the units of a specific | |||
* type we maintain a per type linked list */ | * type we maintain a per type linked list */ | |||
LIST_HEAD(Unit, units_by_type[_UNIT_TYPE_MAX]); | LIST_HEAD(Unit, units_by_type[_UNIT_TYPE_MAX]); | |||
/* To optimize iteration of units that have requires_mounts_for set | ||||
*/ | ||||
LIST_HEAD(Unit, has_requires_mounts_for); | ||||
/* Units that need to be loaded */ | /* Units that need to be loaded */ | |||
LIST_HEAD(Unit, load_queue); /* this is actually more a stack than a queue, but uh. */ | LIST_HEAD(Unit, load_queue); /* this is actually more a stack than a queue, but uh. */ | |||
/* Jobs that need to be run */ | /* Jobs that need to be run */ | |||
LIST_HEAD(Job, run_queue); /* more a stack than a queue, too */ | LIST_HEAD(Job, run_queue); /* more a stack than a queue, too */ | |||
/* Units and jobs that have not yet been announced via | /* Units and jobs that have not yet been announced via | |||
* D-Bus. When something about a job changes it is added here | * D-Bus. When something about a job changes it is added here | |||
* if it is not in there yet. This allows easy coalescing of | * if it is not in there yet. This allows easy coalescing of | |||
* D-Bus change signals. */ | * D-Bus change signals. */ | |||
LIST_HEAD(Unit, dbus_unit_queue); | LIST_HEAD(Unit, dbus_unit_queue); | |||
LIST_HEAD(Job, dbus_job_queue); | LIST_HEAD(Job, dbus_job_queue); | |||
/* Units to remove */ | /* Units to remove */ | |||
LIST_HEAD(Unit, cleanup_queue); | LIST_HEAD(Unit, cleanup_queue); | |||
/* Units to check when doing GC */ | /* Units to check when doing GC */ | |||
LIST_HEAD(Unit, gc_queue); | LIST_HEAD(Unit, gc_queue); | |||
/* Jobs to be added */ | ||||
Hashmap *transaction_jobs; /* Unit object => Job object list 1 | ||||
:1 */ | ||||
JobDependency *transaction_anchor; | ||||
Hashmap *watch_pids; /* pid => Unit object n:1 */ | Hashmap *watch_pids; /* pid => Unit object n:1 */ | |||
char *notify_socket; | char *notify_socket; | |||
Watch notify_watch; | Watch notify_watch; | |||
Watch signal_watch; | Watch signal_watch; | |||
int epoll_fd; | int epoll_fd; | |||
unsigned n_snapshots; | unsigned n_snapshots; | |||
LookupPaths lookup_paths; | LookupPaths lookup_paths; | |||
Set *unit_path_cache; | Set *unit_path_cache; | |||
char **environment; | char **environment; | |||
char **default_controllers; | char **default_controllers; | |||
usec_t runtime_watchdog; | ||||
usec_t shutdown_watchdog; | ||||
dual_timestamp initrd_timestamp; | dual_timestamp initrd_timestamp; | |||
dual_timestamp startup_timestamp; | dual_timestamp startup_timestamp; | |||
dual_timestamp finish_timestamp; | dual_timestamp finish_timestamp; | |||
char *generator_unit_path; | char *generator_unit_path; | |||
char *generator_unit_path_early; | ||||
char *generator_unit_path_late; | ||||
/* Data specific to the device subsystem */ | /* Data specific to the device subsystem */ | |||
struct udev* udev; | struct udev* udev; | |||
struct udev_monitor* udev_monitor; | struct udev_monitor* udev_monitor; | |||
Watch udev_watch; | Watch udev_watch; | |||
Hashmap *devices_by_sysfs; | Hashmap *devices_by_sysfs; | |||
/* Data specific to the mount subsystem */ | /* Data specific to the mount subsystem */ | |||
FILE *proc_self_mountinfo; | FILE *proc_self_mountinfo; | |||
Watch mount_watch; | Watch mount_watch; | |||
skipping to change at line 220 | skipping to change at line 224 | |||
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_run_queue:1; | |||
bool dispatching_dbus_queue:1; | bool dispatching_dbus_queue:1; | |||
bool taint_usr:1; | bool taint_usr:1; | |||
bool show_status; | bool show_status; | |||
bool confirm_spawn; | bool confirm_spawn; | |||
#ifdef HAVE_SYSV_COMPAT | ||||
bool sysv_console; | ||||
#endif | ||||
bool mount_auto; | ||||
bool swap_auto; | ||||
ExecOutput default_std_output, default_std_error; | ExecOutput default_std_output, default_std_error; | |||
struct rlimit *rlimit[RLIMIT_NLIMITS]; | ||||
/* 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; | |||
/* Type=idle pipes */ | ||||
int idle_pipe[2]; | ||||
char *switch_root; | ||||
char *switch_root_init; | ||||
}; | }; | |||
int manager_new(ManagerRunningAs running_as, Manager **m); | int manager_new(ManagerRunningAs 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_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_from_dbus_path(Manager *m, const char *s, Unit **_u); | ||||
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 h, DBusError *e, Unit **_ret); | int manager_load_unit_prepare(Manager *m, const char *name, const char *pat h, DBusError *e, Unit **_ret); | |||
int manager_load_unit(Manager *m, const char *name, const char *path, DBusE rror *e, Unit **_ret); | int manager_load_unit(Manager *m, const char *name, const char *path, DBusE rror *e, Unit **_ret); | |||
int manager_load_unit_from_dbus_path(Manager *m, const char *s, DBusError * e, Unit **_u); | ||||
int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, boo l force, DBusError *e, Job **_ret); | int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, boo l force, DBusError *e, Job **_ret); | |||
int manager_add_job_by_name(Manager *m, JobType type, const char *name, Job Mode mode, bool force, DBusError *e, Job **_ret); | int manager_add_job_by_name(Manager *m, JobType type, const char *name, Job Mode mode, bool force, DBusError *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_transaction_unlink_job(Manager *m, Job *j, bool delete_depende | ||||
ncies); | ||||
void manager_clear_jobs(Manager *m); | void manager_clear_jobs(Manager *m); | |||
unsigned manager_dispatch_load_queue(Manager *m); | unsigned manager_dispatch_load_queue(Manager *m); | |||
unsigned manager_dispatch_run_queue(Manager *m); | unsigned manager_dispatch_run_queue(Manager *m); | |||
unsigned manager_dispatch_dbus_queue(Manager *m); | unsigned manager_dispatch_dbus_queue(Manager *m); | |||
int manager_set_default_controllers(Manager *m, char **controllers); | int manager_set_default_controllers(Manager *m, char **controllers); | |||
int manager_set_default_rlimits(Manager *m, struct rlimit **default_rlimit) ; | ||||
int manager_loop(Manager *m); | int manager_loop(Manager *m); | |||
void manager_dispatch_bus_name_owner_changed(Manager *m, const char *name, const char* old_owner, const char *new_owner); | void manager_dispatch_bus_name_owner_changed(Manager *m, const char *name, const char* old_owner, const char *new_owner); | |||
void manager_dispatch_bus_query_pid_done(Manager *m, const char *name, pid_ t pid); | void manager_dispatch_bus_query_pid_done(Manager *m, const char *name, pid_ t pid); | |||
int manager_open_serialization(Manager *m, FILE **_f); | int manager_open_serialization(Manager *m, FILE **_f); | |||
int manager_serialize(Manager *m, FILE *f, FDSet *fds); | int manager_serialize(Manager *m, FILE *f, FDSet *fds, bool serialize_jobs) ; | |||
int manager_deserialize(Manager *m, FILE *f, FDSet *fds); | int manager_deserialize(Manager *m, FILE *f, FDSet *fds); | |||
int manager_reload(Manager *m); | int manager_reload(Manager *m); | |||
bool manager_is_booting_or_shutting_down(Manager *m); | bool manager_is_booting_or_shutting_down(Manager *m); | |||
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); | |||
skipping to change at line 300 | skipping to change at line 306 | |||
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, bool b); | |||
bool manager_get_show_status(Manager *m); | bool manager_get_show_status(Manager *m); | |||
const char *manager_running_as_to_string(ManagerRunningAs i); | const char *manager_running_as_to_string(ManagerRunningAs i); | |||
ManagerRunningAs manager_running_as_from_string(const char *s); | ManagerRunningAs manager_running_as_from_string(const char *s); | |||
#endif | ||||
End of changes. 18 change blocks. | ||||
21 lines changed or deleted | 26 lines changed or added | |||
missing.h | missing.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foomissinghfoo | #pragma once | |||
#define foomissinghfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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/>. | |||
***/ | ***/ | |||
/* 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 <unistd.h> | #include <unistd.h> | |||
#include <linux/oom.h> | #include <linux/oom.h> | |||
skipping to change at line 136 | skipping to change at line 135 | |||
# define __NR_fanotify_mark 339 | # define __NR_fanotify_mark 339 | |||
# endif | # endif | |||
#endif | #endif | |||
static inline int fanotify_init(unsigned int flags, unsigned int event_f_fl ags) { | static inline int fanotify_init(unsigned int flags, unsigned int event_f_fl ags) { | |||
return syscall(__NR_fanotify_init, flags, event_f_flags); | return syscall(__NR_fanotify_init, flags, event_f_flags); | |||
} | } | |||
static inline int fanotify_mark(int fanotify_fd, unsigned int flags, uint64 _t mask, | static inline int fanotify_mark(int fanotify_fd, unsigned int flags, uint64 _t mask, | |||
int dfd, const char *pathname) { | int dfd, const char *pathname) { | |||
#if defined _MIPS_SIM && _MIPS_SIM == _MIPS_SIM_ABI32 | #if defined _MIPS_SIM && _MIPS_SIM == _MIPS_SIM_ABI32 || defined __powerpc_ _ && !defined __powerpc64__ | |||
union { | union { | |||
uint64_t _64; | uint64_t _64; | |||
uint32_t _32[2]; | uint32_t _32[2]; | |||
} _mask; | } _mask; | |||
_mask._64 = mask; | _mask._64 = mask; | |||
return syscall(__NR_fanotify_mark, fanotify_fd, flags, | return syscall(__NR_fanotify_mark, fanotify_fd, flags, | |||
_mask._32[0], _mask._32[1], dfd, pathname); | _mask._32[0], _mask._32[1], dfd, pathname); | |||
#else | #else | |||
return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask, dfd, p athname); | return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask, dfd, p athname); | |||
skipping to change at line 187 | skipping to change at line 186 | |||
#endif | #endif | |||
static inline pid_t gettid(void) { | static inline pid_t gettid(void) { | |||
return (pid_t) syscall(SYS_gettid); | return (pid_t) syscall(SYS_gettid); | |||
} | } | |||
#ifndef SCM_SECURITY | #ifndef SCM_SECURITY | |||
#define SCM_SECURITY 0x03 | #define SCM_SECURITY 0x03 | |||
#endif | #endif | |||
#ifndef MS_STRICTATIME | ||||
#define MS_STRICTATIME (1<<24) | ||||
#endif | ||||
#ifndef PR_SET_NO_NEW_PRIVS | ||||
#define PR_SET_NO_NEW_PRIVS 38 | ||||
#endif | #endif | |||
End of changes. 6 change blocks. | ||||
7 lines changed or deleted | 12 lines changed or added | |||
mount-setup.h | mount-setup.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foomountsetuphfoo | #pragma once | |||
#define foomountsetuphfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 mount_setup_early(void); | int mount_setup_early(void); | |||
int mount_setup(bool loaded_policy); | int mount_setup(bool loaded_policy); | |||
int mount_cgroup_controllers(char ***join_controllers); | int mount_cgroup_controllers(char ***join_controllers); | |||
bool mount_point_is_api(const char *path); | bool mount_point_is_api(const char *path); | |||
bool mount_point_ignore(const char *path); | bool mount_point_ignore(const char *path); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
mount.h | mount.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foomounthfoo | #pragma once | |||
#define foomounthfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 Mount Mount; | typedef struct Mount Mount; | |||
#include "unit.h" | #include "unit.h" | |||
#include "kill.h" | ||||
typedef enum MountState { | typedef enum MountState { | |||
MOUNT_DEAD, | MOUNT_DEAD, | |||
MOUNT_MOUNTING, /* /bin/mount is running, but the mou nt is not done yet. */ | MOUNT_MOUNTING, /* /bin/mount is running, but the mou nt is not done yet. */ | |||
MOUNT_MOUNTING_DONE, /* /bin/mount is running, and the mou nt is done. */ | MOUNT_MOUNTING_DONE, /* /bin/mount is running, and the mou nt is done. */ | |||
MOUNT_MOUNTED, | MOUNT_MOUNTED, | |||
MOUNT_REMOUNTING, | MOUNT_REMOUNTING, | |||
MOUNT_UNMOUNTING, | MOUNT_UNMOUNTING, | |||
MOUNT_MOUNTING_SIGTERM, | MOUNT_MOUNTING_SIGTERM, | |||
MOUNT_MOUNTING_SIGKILL, | MOUNT_MOUNTING_SIGKILL, | |||
skipping to change at line 78 | skipping to change at line 78 | |||
MOUNT_FAILURE_CORE_DUMP, | MOUNT_FAILURE_CORE_DUMP, | |||
_MOUNT_RESULT_MAX, | _MOUNT_RESULT_MAX, | |||
_MOUNT_RESULT_INVALID = -1 | _MOUNT_RESULT_INVALID = -1 | |||
} MountResult; | } MountResult; | |||
struct Mount { | struct Mount { | |||
Unit meta; | Unit meta; | |||
char *where; | char *where; | |||
MountParameters parameters_etc_fstab; | ||||
MountParameters parameters_proc_self_mountinfo; | MountParameters parameters_proc_self_mountinfo; | |||
MountParameters parameters_fragment; | MountParameters parameters_fragment; | |||
bool from_etc_fstab:1; | ||||
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; | |||
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; | ||||
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; | Watch timer_watch; | |||
}; | }; | |||
skipping to change at line 123 | skipping to change at line 122 | |||
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 char* mount_state_to_string(MountState i); | |||
MountState mount_state_from_string(const char *s); | MountState mount_state_from_string(const char *s); | |||
const char* mount_exec_command_to_string(MountExecCommand i); | const char* mount_exec_command_to_string(MountExecCommand i); | |||
MountExecCommand mount_exec_command_from_string(const char *s); | MountExecCommand mount_exec_command_from_string(const char *s); | |||
const char* mount_result_to_string(MountResult i); | const char* mount_result_to_string(MountResult i); | |||
MountResult mount_result_from_string(const char *s); | MountResult mount_result_from_string(const char *s); | |||
#endif | ||||
End of changes. 9 change blocks. | ||||
8 lines changed or deleted | 7 lines changed or added | |||
namespace.h | namespace.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foonamespacehfoo | #pragma once | |||
#define foonamespacehfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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_namespace( | int setup_namespace( | |||
char **writable, | char **writable, | |||
char **readable, | char **readable, | |||
char **inaccessible, | char **inaccessible, | |||
bool private_tmp, | bool private_tmp, | |||
unsigned long flags); | unsigned long flags); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
pager.h | pager.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foopagerhfoo | #pragma once | |||
#define foopagerhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 pager_open(void); | void pager_open(void); | |||
void pager_close(void); | void pager_close(void); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
path-lookup.h | path-lookup.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foopathlookuphfoo | #pragma once | |||
#define foopathlookuphfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 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; | |||
#include "manager.h" | #include "manager.h" | |||
int user_config_home(char **config_home); | int user_config_home(char **config_home); | |||
int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as, bool per sonal); | int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as, bool per sonal, const char *generator, const char *generator_early, const char *gene rator_late); | |||
void lookup_paths_free(LookupPaths *p); | void lookup_paths_free(LookupPaths *p); | |||
#endif | ||||
End of changes. 6 change blocks. | ||||
7 lines changed or deleted | 6 lines changed or added | |||
path.h | path.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foopathhfoo | #pragma once | |||
#define foopathhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 Path Path; | typedef struct Path Path; | |||
#include "unit.h" | #include "unit.h" | |||
#include "mount.h" | #include "mount.h" | |||
typedef enum PathState { | typedef enum PathState { | |||
PATH_DEAD, | PATH_DEAD, | |||
skipping to change at line 112 | skipping to change at line 111 | |||
extern const UnitVTable path_vtable; | extern const UnitVTable path_vtable; | |||
const char* path_state_to_string(PathState i); | const char* path_state_to_string(PathState i); | |||
PathState path_state_from_string(const char *s); | PathState path_state_from_string(const char *s); | |||
const char* path_type_to_string(PathType i); | const char* path_type_to_string(PathType i); | |||
PathType path_type_from_string(const char *s); | PathType path_type_from_string(const char *s); | |||
const char* path_result_to_string(PathResult i); | const char* path_result_to_string(PathResult i); | |||
PathResult path_result_from_string(const char *s); | PathResult path_result_from_string(const char *s); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
polkit.h | polkit.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foopolkithfoo | #pragma once | |||
#define foopolkithfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <dbus/dbus.h> | #include <dbus/dbus.h> | |||
int verify_polkit( | int verify_polkit( | |||
DBusConnection *c, | DBusConnection *c, | |||
DBusMessage *request, | DBusMessage *request, | |||
const char *action, | const char *action, | |||
bool interactive, | bool interactive, | |||
bool *challenge, | bool *challenge, | |||
DBusError *error); | DBusError *error); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
ratelimit.h | ratelimit.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooratelimithfoo | #pragma once | |||
#define fooratelimithfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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" | |||
typedef struct RateLimit { | typedef struct RateLimit { | |||
usec_t interval; | usec_t interval; | |||
usec_t begin; | usec_t begin; | |||
unsigned burst; | unsigned burst; | |||
unsigned num; | unsigned num; | |||
skipping to change at line 51 | skipping to change at line 50 | |||
#define RATELIMIT_INIT(v, _interval, _burst) \ | #define RATELIMIT_INIT(v, _interval, _burst) \ | |||
do { \ | do { \ | |||
RateLimit *_r = &(v); \ | RateLimit *_r = &(v); \ | |||
_r->interval = (_interval); \ | _r->interval = (_interval); \ | |||
_r->burst = (_burst); \ | _r->burst = (_burst); \ | |||
_r->num = 0; \ | _r->num = 0; \ | |||
_r->begin = 0; \ | _r->begin = 0; \ | |||
} while (false) | } while (false) | |||
bool ratelimit_test(RateLimit *r); | #define RATELIMIT_RESET(v) \ | |||
do { \ | ||||
RateLimit *_r = &(v); \ | ||||
_r->num = 0; \ | ||||
_r->begin = 0; \ | ||||
} while (false) | ||||
#endif | bool ratelimit_test(RateLimit *r); | |||
End of changes. 6 change blocks. | ||||
7 lines changed or deleted | 11 lines changed or added | |||
readahead-common.h | readahead-common.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooreadaheadcommonhfoo | #pragma once | |||
#define fooreadaheadcommonhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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/stat.h> | #include <sys/stat.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include "macro.h" | #include "macro.h" | |||
#include "util.h" | ||||
#define READAHEAD_FILE_SIZE_MAX (10*1024*1024) | #define READAHEAD_FILE_SIZE_MAX (10*1024*1024) | |||
#define READAHEAD_PACK_FILE_VERSION ";VERSION=2\n" | ||||
extern unsigned arg_files_max; | ||||
extern off_t arg_file_size_max; | ||||
extern usec_t arg_timeout; | ||||
int file_verify(int fd, const char *fn, off_t file_size_max, struct stat *s t); | int file_verify(int fd, const char *fn, off_t file_size_max, struct stat *s t); | |||
int fs_on_ssd(const char *p); | int fs_on_ssd(const char *p); | |||
int fs_on_read_only(const char *p); | int fs_on_read_only(const char *p); | |||
bool enough_ram(void); | bool enough_ram(void); | |||
int open_inotify(void); | int open_inotify(void); | |||
typedef struct ReadaheadShared { | typedef struct ReadaheadShared { | |||
pid_t collect; | pid_t collect; | |||
pid_t replay; | pid_t replay; | |||
} _packed_ ReadaheadShared; | } _packed_ ReadaheadShared; | |||
ReadaheadShared *shared_get(void); | ReadaheadShared *shared_get(void); | |||
int bump_request_nr(const char *p); | int block_bump_request_nr(const char *p); | |||
int block_get_readahead(const char *p, uint64_t *bytes); | ||||
int block_set_readahead(const char *p, uint64_t bytes); | ||||
#endif | int main_collect(const char *root); | |||
int main_replay(const char *root); | ||||
int main_analyze(const char *pack_path); | ||||
End of changes. 8 change blocks. | ||||
7 lines changed or deleted | 16 lines changed or added | |||
sd-daemon.h | sd-daemon.h | |||
---|---|---|---|---|
skipping to change at line 67 | skipping to change at line 67 | |||
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-daemon.h | http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h | |||
http://cgit.freedesktop.org/systemd/systemd/plain/src/sd-daemon.c | http://cgit.freedesktop.org/systemd/systemd/plain/src/sd-daemon.c | |||
This should compile on non-Linux systems, too, but with the | This should compile on non-Linux systems, too, but with the | |||
exception of the sd_is_xxx() calls all functions will become NOPs. | exception of the sd_is_xxx() calls all functions will become NOPs. | |||
See sd-daemon(7) for more information. | See sd-daemon(3) for more information. | |||
*/ | */ | |||
#ifndef _sd_printf_attr_ | #ifndef _sd_printf_attr_ | |||
#if __GNUC__ >= 4 | #if __GNUC__ >= 4 | |||
#define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) | #define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) | |||
#else | #else | |||
#define _sd_printf_attr_(a,b) | #define _sd_printf_attr_(a,b) | |||
#endif | #endif | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
sd-id128.h | sd-id128.h | |||
---|---|---|---|---|
skipping to change at line 12 | skipping to change at line 12 | |||
#ifndef fooid128hfoo | #ifndef fooid128hfoo | |||
#define fooid128hfoo | #define fooid128hfoo | |||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <string.h> | #include <string.h> | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
/* 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]); | char *sd_id128_to_string(sd_id128_t id, char s[33]); | |||
int sd_id128_from_string(const char s[33], sd_id128_t *ret); | int sd_id128_from_string(const char s[33], sd_id128_t *ret); | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 6 lines changed or added | |||
sd-journal.h | sd-journal.h | |||
---|---|---|---|---|
skipping to change at line 12 | skipping to change at line 12 | |||
#ifndef foojournalhfoo | #ifndef foojournalhfoo | |||
#define foojournalhfoo | #define foojournalhfoo | |||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <systemd/sd-id128.h> | #include <systemd/sd-id128.h> | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
/* Write to daemon */ | /* Journal APIs. See sd-journal(3) for more information. */ | |||
int sd_journal_print(int piority, const char *format, ...) __attribute__ (( | /* Write to daemon */ | |||
format (printf, 2, 3))); | int sd_journal_print(int priority, const char *format, ...) __attribute__ ( | |||
(format (printf, 2, 3))); | ||||
int sd_journal_printv(int priority, const char *format, va_list ap); | int sd_journal_printv(int priority, const char *format, va_list ap); | |||
int sd_journal_send(const char *format, ...) __attribute__((sentinel)); | int sd_journal_send(const char *format, ...) __attribute__((sentinel)); | |||
int sd_journal_sendv(const struct iovec *iov, int n); | int sd_journal_sendv(const struct iovec *iov, int n); | |||
/* Used by the macros below. Don't call this directly. */ | ||||
int sd_journal_print_with_location(int priority, const char *file, const ch | ||||
ar *line, const char *func, const char *format, ...) __attribute__ ((format | ||||
(printf, 5, 6))); | ||||
int sd_journal_printv_with_location(int priority, const char *file, const c | ||||
har *line, const char *func, const char *format, va_list ap); | ||||
int sd_journal_send_with_location(const char *file, const char *line, const | ||||
char *func, const char *format, ...) __attribute__((sentinel)); | ||||
int sd_journal_sendv_with_location(const char *file, const char *line, cons | ||||
t char *func, const struct iovec *iov, int n); | ||||
/* implicitly add code location to messages sent, if this is enabled */ | ||||
#ifndef SD_JOURNAL_SUPPRESS_LOCATION | ||||
#define _sd_XSTRINGIFY(x) #x | ||||
#define _sd_STRINGIFY(x) _sd_XSTRINGIFY(x) | ||||
#define sd_journal_print(priority, ...) sd_journal_print_with_location(prio | ||||
rity, "CODE_FILE=" __FILE__, "CODE_LINE=" _sd_STRINGIFY(__LINE__), __func__ | ||||
, __VA_ARGS__) | ||||
#define sd_journal_printv(priority, format, ap) sd_journal_printv_with_loca | ||||
tion(priority, "CODE_FILE=" __FILE__, "CODE_LINE=" _sd_STRINGIFY(__LINE__), | ||||
__func__, format, ap) | ||||
#define sd_journal_send(...) sd_journal_send_with_location("CODE_FILE=" __F | ||||
ILE__, "CODE_LINE=" _sd_STRINGIFY(__LINE__), __func__, __VA_ARGS__) | ||||
#define sd_journal_sendv(iovec, n) sd_journal_sendv_with_location("CODE_FIL | ||||
E=" __FILE__, "CODE_LINE=" _sd_STRINGIFY(__LINE__), __func__, iovec, n) | ||||
#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; | |||
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_ONLY = 4 | SD_JOURNAL_SYSTEM_ONLY = 4 | |||
}; | }; | |||
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 ); | ||||
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); | |||
int sd_journal_get_data(sd_journal *j, const char *field, const void **data , size_t *l); | int sd_journal_get_data(sd_journal *j, const char *field, const void **data , size_t *l); | |||
int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t *l); | int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t *l); | |||
void sd_journal_restart_data(sd_journal *j); | void sd_journal_restart_data(sd_journal *j); | |||
int sd_journal_add_match(sd_journal *j, const void *data, size_t size); | int sd_journal_add_match(sd_journal *j, const void *data, size_t size); | |||
int sd_journal_add_disjunction(sd_journal *j); | ||||
void sd_journal_flush_matches(sd_journal *j); | void sd_journal_flush_matches(sd_journal *j); | |||
int sd_journal_seek_head(sd_journal *j); | int sd_journal_seek_head(sd_journal *j); | |||
int sd_journal_seek_tail(sd_journal *j); | int sd_journal_seek_tail(sd_journal *j); | |||
int sd_journal_seek_monotonic_usec(sd_journal *j, sd_id128_t boot_id, uint6 4_t usec); | int sd_journal_seek_monotonic_usec(sd_journal *j, sd_id128_t boot_id, uint6 4_t usec); | |||
int sd_journal_seek_realtime_usec(sd_journal *j, uint64_t usec); | int sd_journal_seek_realtime_usec(sd_journal *j, uint64_t usec); | |||
int sd_journal_seek_cursor(sd_journal *j, const char *cursor); | int sd_journal_seek_cursor(sd_journal *j, const char *cursor); | |||
int sd_journal_get_cursor(sd_journal *j, char **cursor); | int sd_journal_get_cursor(sd_journal *j, char **cursor); | |||
int sd_journal_get_cutoff_realtime_usec(sd_journal *j, uint64_t *from, uint | ||||
64_t *to); | ||||
int sd_journal_get_cutoff_monotonic_usec(sd_journal *j, const sd_id128_t bo | ||||
ot_id, uint64_t *from, uint64_t *to); | ||||
/* int sd_journal_query_unique(sd_journal *j, const char *field); /\* missing *\/ */ | /* int sd_journal_query_unique(sd_journal *j, const char *field); /\* missing *\/ */ | |||
/* int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_t *l); /\* missing *\/ */ | /* int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_t *l); /\* missing *\/ */ | |||
/* void sd_journal_restart_unique(sd_journal *j); /\* missing *\/ */ | /* void sd_journal_restart_unique(sd_journal *j); /\* missing *\/ */ | |||
enum { | enum { | |||
SD_JOURNAL_NOP, | SD_JOURNAL_NOP, | |||
SD_JOURNAL_APPEND, | SD_JOURNAL_APPEND, | |||
SD_JOURNAL_INVALIDATE_ADD, | SD_JOURNAL_INVALIDATE | |||
SD_JOURNAL_INVALIDATE_REMOVE | ||||
}; | }; | |||
int sd_journal_get_fd(sd_journal *j); | int sd_journal_get_fd(sd_journal *j); | |||
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); | ||||
#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_data((j), & | \ */ | |||
(data), &(l)) > 0; ) | /* for (sd_journal_restart_unique(j); sd_journal_enumerate_data((j) | |||
, &(data), &(l)) > 0; ) */ | ||||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
#endif | #endif | |||
End of changes. 15 change blocks. | ||||
13 lines changed or deleted | 53 lines changed or added | |||
sd-login.h | sd-login.h | |||
---|---|---|---|---|
skipping to change at line 12 | skipping to change at line 12 | |||
#ifndef foosdloginhfoo | #ifndef foosdloginhfoo | |||
#define foosdloginhfoo | #define foosdloginhfoo | |||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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> | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #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 we return with libc free(). | * Free the data the library returns with libc free(). String arrays | |||
* are NULL terminated and you need to free the array itself in | ||||
* 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. 0 or | |||
* positive on success. | * positive on success. | |||
* | * | |||
* 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, hence the accesses are | |||
* relatively cheap. | * relatively cheap. | |||
* | ||||
* See sd-login(3) for more information. | ||||
*/ | */ | |||
/* 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 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. This will return an | /* Get systemd unit (i.e. service) name from PID. This will return an | |||
* error for non-service processes. */ | * error for non-service processes. */ | |||
int sd_pid_get_unit(pid_t, char **unit); | int sd_pid_get_unit(pid_t, char **unit); | |||
/* Get state from uid. Possible states: offline, lingering, online, active */ | /* Get state from uid. Possible states: offline, lingering, online, active, closing */ | |||
int sd_uid_get_state(uid_t uid, char**state); | int sd_uid_get_state(uid_t uid, char**state); | |||
/* Return 1 if uid has session on seat. If require_active is true will | /* Return 1 if uid has session on seat. If require_active is true will | |||
* 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 will look for | |||
* active sessions only. Returns number of sessions as return | * active sessions only. Returns number of sessions as return | |||
* value. If sessions is NULL will just return number of sessions. */ | * value. If sessions is NULL will just return 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 will look for | |||
* active seats only. Returns number of seats. If seats is NULL will | * active seats only. Returns number of seats. If seats is NULL will | |||
* just return number of seats.*/ | * just return 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 a 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 | ||||
* (This function is a more generic version of | ||||
* sd_session_is_active().) */ | ||||
int sd_session_get_state(const char *sessio, char **state); | ||||
/* Determine user id of session */ | /* 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" or "unspeci fied". */ | |||
skipping to change at line 113 | skipping to change at line 122 | |||
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 as | |||
* return value. If sessions is NULL returns only the number of | * return value. If sessions is NULL 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 */ | ||||
int sd_seat_can_tty(const char *seat); | ||||
/* Return whether the seat is graphics capable, i.e. suitable for showing g | ||||
raphical UIs */ | ||||
int sd_seat_can_graphical(const char *seat); | ||||
/* 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 only returns 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 only returns 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 only returns the number of users. */ | |||
End of changes. 9 change blocks. | ||||
7 lines changed or deleted | 24 lines changed or added | |||
sd-messages.h | sd-messages.h | |||
---|---|---|---|---|
skipping to change at line 12 | skipping to change at line 12 | |||
#ifndef foosdmessageshfoo | #ifndef foosdmessageshfoo | |||
#define foosdmessageshfoo | #define foosdmessageshfoo | |||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <systemd/sd-id128.h> | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
#define SD_MESSAGE_JOURNAL_START SD_ID128_MAKE(f7,73,79,a8,49,0b,40,8b,be ,5f,69,40,50,5a,77,7b) | #define SD_MESSAGE_JOURNAL_START SD_ID128_MAKE(f7,73,79,a8,49,0b,40,8b,be ,5f,69,40,50,5a,77,7b) | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
sd-readahead.h | sd-readahead.h | |||
---|---|---|---|---|
skipping to change at line 56 | skipping to change at line 56 | |||
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(7) for more information. | See sd-readahead(3) for more information. | |||
*/ | */ | |||
/* | /* | |||
Controls ongoing disk read-ahead operations during boot-up. The argument | Controls ongoing disk read-ahead operations during boot-up. The argument | |||
must be a string, and either "cancel", "done" or "noreplay". | must be a string, and either "cancel", "done" or "noreplay". | |||
cancel = terminate read-ahead data collection, drop collected information | cancel = terminate read-ahead data collection, drop collected information | |||
done = terminate read-ahead data collection, keep collected information | done = terminate read-ahead data collection, keep collected information | |||
noreplay = terminate read-ahead replay | noreplay = terminate read-ahead replay | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
selinux-setup.h | selinux-setup.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooselinuxsetuphfoo | #pragma once | |||
#define fooselinuxsetuphfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 selinux_setup(bool *loaded_policy); | int selinux_setup(bool *loaded_policy); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
service.h | service.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooservicehfoo | #pragma once | |||
#define fooservicehfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 "service.h" | |||
#include "kill.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 */ | |||
SERVICE_RELOAD, | SERVICE_RELOAD, | |||
SERVICE_STOP, /* No STOP_PRE state, instead just regis ter multiple STOP executables */ | SERVICE_STOP, /* No STOP_PRE state, instead just regis ter multiple STOP executables */ | |||
skipping to change at line 68 | skipping to change at line 68 | |||
_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) */ | |||
SERVICE_ONESHOT, /* we fork and wait until the program finishes (i .e. programs like fsck which run and need to finish before we continue) */ | SERVICE_ONESHOT, /* we fork and wait until the program finishes (i .e. programs like fsck which run and need to finish before we continue) */ | |||
SERVICE_DBUS, /* we fork and wait until a specific D-Bus name a ppears on the bus */ | SERVICE_DBUS, /* we fork and wait until a specific D-Bus name a ppears on the bus */ | |||
SERVICE_NOTIFY, /* we fork and wait until a daemon sends us a rea dy message with sd_notify() */ | SERVICE_NOTIFY, /* we fork and wait until a daemon sends us a rea dy message with sd_notify() */ | |||
SERVICE_IDLE, /* much like simple, but delay exec() until all j obs are dispatched. */ | ||||
_SERVICE_TYPE_MAX, | _SERVICE_TYPE_MAX, | |||
_SERVICE_TYPE_INVALID = -1 | _SERVICE_TYPE_INVALID = -1 | |||
} ServiceType; | } ServiceType; | |||
typedef enum ServiceExecCommand { | typedef enum ServiceExecCommand { | |||
SERVICE_EXEC_START_PRE, | SERVICE_EXEC_START_PRE, | |||
SERVICE_EXEC_START, | SERVICE_EXEC_START, | |||
SERVICE_EXEC_START_POST, | SERVICE_EXEC_START_POST, | |||
SERVICE_EXEC_RELOAD, | SERVICE_EXEC_RELOAD, | |||
SERVICE_EXEC_STOP, | SERVICE_EXEC_STOP, | |||
skipping to change at line 129 | skipping to change at line 130 | |||
char *pid_file; | char *pid_file; | |||
usec_t restart_usec; | usec_t restart_usec; | |||
usec_t timeout_usec; | usec_t timeout_usec; | |||
dual_timestamp watchdog_timestamp; | dual_timestamp watchdog_timestamp; | |||
usec_t watchdog_usec; | usec_t watchdog_usec; | |||
Watch watchdog_watch; | Watch watchdog_watch; | |||
ExecCommand* exec_command[_SERVICE_EXEC_COMMAND_MAX]; | ExecCommand* exec_command[_SERVICE_EXEC_COMMAND_MAX]; | |||
ExecContext exec_context; | ExecContext exec_context; | |||
KillContext kill_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 */ | |||
ExecStatus main_exec_status; | ExecStatus main_exec_status; | |||
/* The currently executed control process */ | /* The currently executed control process */ | |||
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 | |||
skipping to change at line 166 | skipping to change at line 169 | |||
/* 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 got_socket_fd:1; | |||
bool timeout_defined:1; | ||||
#ifdef HAVE_SYSV_COMPAT | #ifdef HAVE_SYSV_COMPAT | |||
bool is_sysv:1; | ||||
bool sysv_has_lsb:1; | bool sysv_has_lsb:1; | |||
bool sysv_enabled:1; | bool sysv_enabled:1; | |||
int sysv_start_priority_from_rcnd; | int sysv_start_priority_from_rcnd; | |||
int sysv_start_priority; | int sysv_start_priority; | |||
char *sysv_path; | ||||
char *sysv_runlevels; | char *sysv_runlevels; | |||
usec_t sysv_mtime; | ||||
#endif | #endif | |||
char *bus_name; | char *bus_name; | |||
char *status_text; | char *status_text; | |||
RateLimit start_limit; | RateLimit start_limit; | |||
StartLimitAction start_limit_action; | StartLimitAction start_limit_action; | |||
UnitRef accept_socket; | UnitRef accept_socket; | |||
skipping to change at line 218 | skipping to change at line 221 | |||
ServiceExecCommand service_exec_command_from_string(const char *s); | ServiceExecCommand service_exec_command_from_string(const char *s); | |||
const char* notify_access_to_string(NotifyAccess i); | const char* notify_access_to_string(NotifyAccess i); | |||
NotifyAccess notify_access_from_string(const char *s); | NotifyAccess notify_access_from_string(const char *s); | |||
const char* service_result_to_string(ServiceResult i); | const char* service_result_to_string(ServiceResult i); | |||
ServiceResult service_result_from_string(const char *s); | ServiceResult service_result_from_string(const char *s); | |||
const char* start_limit_action_to_string(StartLimitAction i); | const char* start_limit_action_to_string(StartLimitAction i); | |||
StartLimitAction start_limit_action_from_string(const char *s); | StartLimitAction start_limit_action_from_string(const char *s); | |||
#endif | ||||
End of changes. 13 change blocks. | ||||
8 lines changed or deleted | 11 lines changed or added | |||
set.h | set.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foosethfoo | #pragma once | |||
#define foosethfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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/>. | |||
***/ | ***/ | |||
/* 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" | |||
skipping to change at line 59 | skipping to change at line 58 | |||
int set_move_one(Set *s, Set *other, void *value); | int set_move_one(Set *s, Set *other, void *value); | |||
unsigned set_size(Set *s); | unsigned set_size(Set *s); | |||
bool set_isempty(Set *s); | bool set_isempty(Set *s); | |||
void *set_iterate(Set *s, Iterator *i); | void *set_iterate(Set *s, Iterator *i); | |||
void *set_iterate_backwards(Set *s, Iterator *i); | void *set_iterate_backwards(Set *s, Iterator *i); | |||
void *set_iterate_skip(Set *s, void *value, Iterator *i); | void *set_iterate_skip(Set *s, void *value, Iterator *i); | |||
void set_clear(Set *s); | void set_clear(Set *s); | |||
void set_clear_free(Set *s); | ||||
void *set_steal_first(Set *s); | void *set_steal_first(Set *s); | |||
void* set_first(Set *s); | void* set_first(Set *s); | |||
void* set_last(Set *s); | void* set_last(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))) | |||
#endif | ||||
End of changes. 6 change blocks. | ||||
6 lines changed or deleted | 7 lines changed or added | |||
snapshot.h | snapshot.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foosnapshothfoo | #pragma once | |||
#define foosnapshothfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 Snapshot Snapshot; | typedef struct Snapshot Snapshot; | |||
#include "unit.h" | #include "unit.h" | |||
typedef enum SnapshotState { | typedef enum SnapshotState { | |||
SNAPSHOT_DEAD, | SNAPSHOT_DEAD, | |||
SNAPSHOT_ACTIVE, | SNAPSHOT_ACTIVE, | |||
skipping to change at line 52 | skipping to change at line 51 | |||
bool by_snapshot_create:1; | bool by_snapshot_create:1; | |||
}; | }; | |||
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, DBusError * e, Snapshot **s); | |||
void snapshot_remove(Snapshot *s); | void snapshot_remove(Snapshot *s); | |||
const char* snapshot_state_to_string(SnapshotState i); | const char* snapshot_state_to_string(SnapshotState i); | |||
SnapshotState snapshot_state_from_string(const char *s); | SnapshotState snapshot_state_from_string(const char *s); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
socket-util.h | socket-util.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foosocketutilhfoo | #pragma once | |||
#define foosocketutilhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <net/if.h> | |||
#include <asm/types.h> | #include <asm/types.h> | |||
#include <linux/netlink.h> | #include <linux/netlink.h> | |||
skipping to change at line 101 | skipping to change at line 100 | |||
bool socket_address_needs_mount(const SocketAddress *a, const char *prefix) ; | bool socket_address_needs_mount(const SocketAddress *a, const char *prefix) ; | |||
const char* socket_address_bind_ipv6_only_to_string(SocketAddressBindIPv6On ly b); | const char* socket_address_bind_ipv6_only_to_string(SocketAddressBindIPv6On ly b); | |||
SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const c har *s); | SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const c har *s); | |||
const char* netlink_family_to_string(int b); | const char* netlink_family_to_string(int b); | |||
int netlink_family_from_string(const char *s); | int netlink_family_from_string(const char *s); | |||
bool socket_ipv6_is_supported(void); | bool socket_ipv6_is_supported(void); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
socket.h | socket.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foosockethfoo | #pragma once | |||
#define foosockethfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 Socket Socket; | typedef struct Socket Socket; | |||
#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" | |||
skipping to change at line 105 | skipping to change at line 104 | |||
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; | ||||
/* 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; | Watch timer_watch; | |||
skipping to change at line 172 | skipping to change at line 172 | |||
extern const UnitVTable socket_vtable; | extern const UnitVTable socket_vtable; | |||
const char* socket_state_to_string(SocketState i); | const char* socket_state_to_string(SocketState i); | |||
SocketState socket_state_from_string(const char *s); | SocketState socket_state_from_string(const char *s); | |||
const char* socket_exec_command_to_string(SocketExecCommand i); | const char* socket_exec_command_to_string(SocketExecCommand i); | |||
SocketExecCommand socket_exec_command_from_string(const char *s); | SocketExecCommand socket_exec_command_from_string(const char *s); | |||
const char* socket_result_to_string(SocketResult i); | const char* socket_result_to_string(SocketResult i); | |||
SocketResult socket_result_from_string(const char *s); | SocketResult socket_result_from_string(const char *s); | |||
#endif | ||||
End of changes. 6 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added | |||
special.h | special.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foospecialhfoo | #pragma once | |||
#define foospecialhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 SPECIAL_DEFAULT_TARGET "default.target" | #define SPECIAL_DEFAULT_TARGET "default.target" | |||
/* Shutdown targets */ | /* Shutdown targets */ | |||
#define SPECIAL_UMOUNT_TARGET "umount.target" | #define SPECIAL_UMOUNT_TARGET "umount.target" | |||
/* This is not really intended to be started by directly. This is | /* This is not really intended to be started by directly. This is | |||
* mostly so that other targets (reboot/halt/poweroff) can depend on | * mostly so that other targets (reboot/halt/poweroff) can depend on | |||
* it to bring all services down that want to be brought down on | * it to bring all services down that want to be brought down on | |||
* system shutdown. */ | * system shutdown. */ | |||
#define SPECIAL_SHUTDOWN_TARGET "shutdown.target" | #define SPECIAL_SHUTDOWN_TARGET "shutdown.target" | |||
#define SPECIAL_HALT_TARGET "halt.target" | #define SPECIAL_HALT_TARGET "halt.target" | |||
#define SPECIAL_POWEROFF_TARGET "poweroff.target" | #define SPECIAL_POWEROFF_TARGET "poweroff.target" | |||
#define SPECIAL_REBOOT_TARGET "reboot.target" | #define SPECIAL_REBOOT_TARGET "reboot.target" | |||
#define SPECIAL_KEXEC_TARGET "kexec.target" | #define SPECIAL_KEXEC_TARGET "kexec.target" | |||
#define SPECIAL_EXIT_TARGET "exit.target" | #define SPECIAL_EXIT_TARGET "exit.target" | |||
#define SPECIAL_SUSPEND_TARGET "suspend.target" | ||||
#define SPECIAL_HIBERNATE_TARGET "hibernate.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_LOCAL_FS_TARGET "local-fs.target" /* LSB's $local_f s */ | #define SPECIAL_LOCAL_FS_TARGET "local-fs.target" /* LSB's $local_f s */ | |||
#define SPECIAL_LOCAL_FS_PRE_TARGET "local-fs-pre.target" | #define SPECIAL_LOCAL_FS_PRE_TARGET "local-fs-pre.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_BASIC_TARGET "basic.target" | #define SPECIAL_BASIC_TARGET "basic.target" | |||
/* LSB compatibility */ | /* LSB compatibility */ | |||
#define SPECIAL_NETWORK_TARGET "network.target" /* LSB's $network */ | #define SPECIAL_NETWORK_TARGET "network.target" /* LSB's $network */ | |||
#define SPECIAL_NSS_LOOKUP_TARGET "nss-lookup.target" /* LSB's $named * / | #define SPECIAL_NSS_LOOKUP_TARGET "nss-lookup.target" /* LSB's $named * / | |||
#define SPECIAL_RPCBIND_TARGET "rpcbind.target" /* LSB's $portmap */ | #define SPECIAL_RPCBIND_TARGET "rpcbind.target" /* LSB's $portmap */ | |||
#define SPECIAL_SYSLOG_TARGET "syslog.target" /* LSB's $syslog; Should pull in syslog.socket or syslog.service */ | #define SPECIAL_SYSLOG_TARGET "syslog.target" /* LSB's $syslog */ | |||
#define SPECIAL_TIME_SYNC_TARGET "time-sync.target" /* LSB's $time */ | #define SPECIAL_TIME_SYNC_TARGET "time-sync.target" /* LSB's $time */ | |||
#define SPECIAL_DISPLAY_MANAGER_SERVICE "display-manager.service" /* Debian's $x-display-manager */ | #define SPECIAL_DISPLAY_MANAGER_SERVICE "display-manager.service" /* Debian's $x-display-manager */ | |||
#define SPECIAL_MAIL_TRANSFER_AGENT_TARGET "mail-transfer-agent.target" /* Debian's $mail-{transport|transfer-agent */ | #define SPECIAL_MAIL_TRANSFER_AGENT_TARGET "mail-transfer-agent.target" /* Debian's $mail-{transport|transfer-agent */ | |||
#define SPECIAL_HTTP_DAEMON_TARGET "http-daemon.target" | #define SPECIAL_HTTP_DAEMON_TARGET "http-daemon.target" | |||
/* Magic early boot services */ | /* Magic early boot services */ | |||
#define SPECIAL_FSCK_SERVICE "fsck@.service" | #define SPECIAL_FSCK_SERVICE "systemd-fsck@.service" | |||
#define SPECIAL_QUOTACHECK_SERVICE "quotacheck.service" | #define SPECIAL_QUOTACHECK_SERVICE "systemd-quotacheck.service" | |||
#define SPECIAL_QUOTAON_SERVICE "quotaon.service" | #define SPECIAL_QUOTAON_SERVICE "quotaon.service" | |||
#define SPECIAL_REMOUNT_ROOTFS_SERVICE "remount-rootfs.service" | #define SPECIAL_REMOUNT_FS_SERVICE "systemd-remount-fs.service" | |||
/* Services systemd relies on */ | /* Services systemd relies on */ | |||
#define SPECIAL_DBUS_SERVICE "dbus.service" | #define SPECIAL_DBUS_SERVICE "dbus.service" | |||
#define SPECIAL_DBUS_SOCKET "dbus.socket" | #define SPECIAL_DBUS_SOCKET "dbus.socket" | |||
#define SPECIAL_JOURNALD_SOCKET "systemd-journald.socket" | #define SPECIAL_JOURNALD_SOCKET "systemd-journald.socket" | |||
#define SPECIAL_JOURNALD_SERVICE "systemd-journald.service" | #define SPECIAL_JOURNALD_SERVICE "systemd-journald.service" | |||
/* Magic init signals */ | /* Magic init signals */ | |||
#define SPECIAL_KBREQUEST_TARGET "kbrequest.target" | #define SPECIAL_KBREQUEST_TARGET "kbrequest.target" | |||
#define SPECIAL_SIGPWR_TARGET "sigpwr.target" | #define SPECIAL_SIGPWR_TARGET "sigpwr.target" | |||
#define SPECIAL_CTRL_ALT_DEL_TARGET "ctrl-alt-del.target" | #define SPECIAL_CTRL_ALT_DEL_TARGET "ctrl-alt-del.target" | |||
/* For SysV compatibility. Usually an alias for a saner target. On | /* For SysV compatibility. Usually an alias for a saner target. On | |||
* SysV-free systems this doesn't exist. */ | * SysV-free systems this doesn't exist. */ | |||
#define SPECIAL_RUNLEVEL2_TARGET "runlevel2.target" | #define SPECIAL_RUNLEVEL2_TARGET "runlevel2.target" | |||
#define SPECIAL_RUNLEVEL3_TARGET "runlevel3.target" | #define SPECIAL_RUNLEVEL3_TARGET "runlevel3.target" | |||
#define SPECIAL_RUNLEVEL4_TARGET "runlevel4.target" | #define SPECIAL_RUNLEVEL4_TARGET "runlevel4.target" | |||
#define SPECIAL_RUNLEVEL5_TARGET "runlevel5.target" | #define SPECIAL_RUNLEVEL5_TARGET "runlevel5.target" | |||
#endif | ||||
End of changes. 9 change blocks. | ||||
10 lines changed or deleted | 11 lines changed or added | |||
specifier.h | specifier.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foospecifierhfoo | #pragma once | |||
#define foospecifierhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 char* (*SpecifierCallback)(char specifier, void *data, void *userda ta); | typedef char* (*SpecifierCallback)(char specifier, void *data, void *userda ta); | |||
typedef struct Specifier { | typedef struct Specifier { | |||
const char specifier; | const char specifier; | |||
const SpecifierCallback lookup; | const SpecifierCallback lookup; | |||
void *data; | void *data; | |||
} Specifier; | } Specifier; | |||
char *specifier_printf(const char *text, const Specifier table[], void *use rdata); | char *specifier_printf(const char *text, const Specifier table[], void *use rdata); | |||
char* specifier_string(char specifier, void *data, void *userdata); | char* specifier_string(char specifier, void *data, void *userdata); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
strv.h | strv.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foostrvhfoo | #pragma once | |||
#define foostrvhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 "macro.h" | |||
char *strv_find(char **l, const char *name); | char *strv_find(char **l, const char *name); | |||
char *strv_find_prefix(char **l, const char *name); | char *strv_find_prefix(char **l, const char *name); | |||
void strv_free(char **l); | void strv_free(char **l); | |||
char **strv_copy(char **l) _malloc_; | char **strv_copy(char **l) _malloc_; | |||
unsigned strv_length(char **l); | unsigned strv_length(char **l); | |||
char **strv_merge(char **a, char **b); | char **strv_merge(char **a, char **b); | |||
char **strv_merge_concat(char **a, char **b, const char *suffix); | char **strv_merge_concat(char **a, char **b, const char *suffix); | |||
char **strv_append(char **l, const char *s); | char **strv_append(char **l, const char *s); | |||
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_ _malloc_; | char **strv_new(const char *x, ...) _sentinel_ _malloc_; | |||
char **strv_new_ap(const char *x, va_list ap) _malloc_; | char **strv_new_ap(const char *x, va_list ap) _malloc_; | |||
static inline const char* STRV_IFNOTNULL(const char *x) { | ||||
return x ? x : (const char *) -1; | ||||
} | ||||
static inline bool strv_isempty(char **l) { | static inline bool strv_isempty(char **l) { | |||
return !l || !*l; | return !l || !*l; | |||
} | } | |||
char **strv_split(const char *s, const char *separator) _malloc_; | char **strv_split(const char *s, const char *separator) _malloc_; | |||
char **strv_split_quoted(const char *s) _malloc_; | char **strv_split_quoted(const char *s) _malloc_; | |||
char *strv_join(char **l, const char *separator) _malloc_; | char *strv_join(char **l, const char *separator) _malloc_; | |||
char **strv_env_merge(unsigned n_lists, ...); | char **strv_env_merge(unsigned n_lists, ...); | |||
skipping to change at line 78 | skipping to change at line 82 | |||
char **strv_parse_nulstr(const char *s, size_t l); | char **strv_parse_nulstr(const char *s, size_t l); | |||
bool strv_overlap(char **a, char **b); | bool strv_overlap(char **a, char **b); | |||
#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)--) | for (; (l) && ((s) >= (l)); (s)--) | |||
#endif | ||||
End of changes. 7 change blocks. | ||||
6 lines changed or deleted | 10 lines changed or added | |||
swap.h | swap.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooswaphfoo | #pragma once | |||
#define fooswaphfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2010 Lennart Poettering | Copyright 2010 Lennart Poettering | |||
Copyright 2010 Maarten Lankhorst | Copyright 2010 Maarten Lankhorst | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 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, | |||
skipping to change at line 56 | skipping to change at line 55 | |||
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 { | typedef struct SwapParameters { | |||
char *what; | char *what; | |||
int priority; | int priority; | |||
bool noauto:1; | bool noauto:1; | |||
bool nofail:1; | bool nofail:1; | |||
bool handle:1; | ||||
} SwapParameters; | } 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; | |||
struct Swap { | struct Swap { | |||
Unit meta; | Unit meta; | |||
char *what; | char *what; | |||
SwapParameters parameters_etc_fstab; | ||||
SwapParameters parameters_proc_swaps; | SwapParameters parameters_proc_swaps; | |||
SwapParameters parameters_fragment; | SwapParameters parameters_fragment; | |||
bool from_etc_fstab:1; | ||||
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; | ||||
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; | Watch timer_watch; | |||
/* 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_proc_swaps); | |||
}; | }; | |||
extern const UnitVTable swap_vtable; | extern const UnitVTable swap_vtable; | |||
int swap_add_one(Manager *m, const char *what, const char *what_proc_swaps, | ||||
int prio, bool no_auto, bool no_fail, bool handle, bool set_flags); | ||||
int swap_add_one_mount_link(Swap *s, Mount *m); | int swap_add_one_mount_link(Swap *s, Mount *m); | |||
int swap_dispatch_reload(Manager *m); | int swap_dispatch_reload(Manager *m); | |||
int swap_fd_event(Manager *m, int events); | int swap_fd_event(Manager *m, int events); | |||
const char* swap_state_to_string(SwapState i); | const char* swap_state_to_string(SwapState i); | |||
SwapState swap_state_from_string(const char *s); | SwapState swap_state_from_string(const char *s); | |||
const char* swap_exec_command_to_string(SwapExecCommand i); | const char* swap_exec_command_to_string(SwapExecCommand i); | |||
SwapExecCommand swap_exec_command_from_string(const char *s); | SwapExecCommand swap_exec_command_from_string(const char *s); | |||
const char* swap_result_to_string(SwapResult i); | const char* swap_result_to_string(SwapResult i); | |||
SwapResult swap_result_from_string(const char *s); | SwapResult swap_result_from_string(const char *s); | |||
#endif | ||||
End of changes. 10 change blocks. | ||||
12 lines changed or deleted | 6 lines changed or added | |||
sysfs-show.h | sysfs-show.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foosysfsshowhfoo | #pragma once | |||
#define foosysfsshowhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 show_sysfs(const char *seat, const char *prefix, unsigned columns); | int show_sysfs(const char *seat, const char *prefix, unsigned columns); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
target.h | target.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef footargethfoo | #pragma once | |||
#define footargethfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 Target Target; | typedef struct Target Target; | |||
#include "unit.h" | #include "unit.h" | |||
typedef enum TargetState { | typedef enum TargetState { | |||
TARGET_DEAD, | TARGET_DEAD, | |||
TARGET_ACTIVE, | TARGET_ACTIVE, | |||
skipping to change at line 46 | skipping to change at line 45 | |||
struct Target { | struct Target { | |||
Unit meta; | Unit meta; | |||
TargetState state, deserialized_state; | TargetState state, deserialized_state; | |||
}; | }; | |||
extern const UnitVTable target_vtable; | extern const UnitVTable target_vtable; | |||
const char* target_state_to_string(TargetState i); | const char* target_state_to_string(TargetState i); | |||
TargetState target_state_from_string(const char *s); | TargetState target_state_from_string(const char *s); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
tcpwrap.h | tcpwrap.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foolibwraphfoo | #pragma once | |||
#define foolibwraphfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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> | |||
bool socket_tcpwrap(int fd, const char *name); | bool socket_tcpwrap(int fd, const char *name); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
timer.h | timer.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef footimerhfoo | #pragma once | |||
#define footimerhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 Timer Timer; | typedef struct Timer Timer; | |||
#include "unit.h" | #include "unit.h" | |||
typedef enum TimerState { | typedef enum TimerState { | |||
TIMER_DEAD, | TIMER_DEAD, | |||
TIMER_WAITING, | TIMER_WAITING, | |||
skipping to change at line 92 | skipping to change at line 91 | |||
extern const UnitVTable timer_vtable; | extern const UnitVTable timer_vtable; | |||
const char *timer_state_to_string(TimerState i); | const char *timer_state_to_string(TimerState i); | |||
TimerState timer_state_from_string(const char *s); | TimerState timer_state_from_string(const char *s); | |||
const char *timer_base_to_string(TimerBase i); | const char *timer_base_to_string(TimerBase i); | |||
TimerBase timer_base_from_string(const char *s); | TimerBase timer_base_from_string(const char *s); | |||
const char* timer_result_to_string(TimerResult i); | const char* timer_result_to_string(TimerResult i); | |||
TimerResult timer_result_from_string(const char *s); | TimerResult timer_result_from_string(const char *s); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
umount.h | umount.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooumounthfoo | #pragma once | |||
#define fooumounthfoo | ||||
/*** | /*** | |||
This file is part of systemd. | This file is part of systemd. | |||
Copyright 2010 ProFUSION embedded systems | Copyright 2010 ProFUSION embedded systems | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 umount_all(bool *changed); | int umount_all(bool *changed); | |||
int swapoff_all(bool *changed); | int swapoff_all(bool *changed); | |||
int loopback_detach_all(bool *changed); | int loopback_detach_all(bool *changed); | |||
int dm_detach_all(bool *changed); | int dm_detach_all(bool *changed); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
unit-name.h | unit-name.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foounitnamehfoo | #pragma once | |||
#define foounitnamehfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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> | |||
#define UNIT_NAME_MAX 256 | #define UNIT_NAME_MAX 256 | |||
typedef enum UnitType UnitType; | ||||
typedef enum UnitLoadState UnitLoadState; | ||||
enum UnitType { | ||||
UNIT_SERVICE = 0, | ||||
UNIT_SOCKET, | ||||
UNIT_TARGET, | ||||
UNIT_DEVICE, | ||||
UNIT_MOUNT, | ||||
UNIT_AUTOMOUNT, | ||||
UNIT_SNAPSHOT, | ||||
UNIT_TIMER, | ||||
UNIT_SWAP, | ||||
UNIT_PATH, | ||||
_UNIT_TYPE_MAX, | ||||
_UNIT_TYPE_INVALID = -1 | ||||
}; | ||||
enum UnitLoadState { | ||||
UNIT_STUB, | ||||
UNIT_LOADED, | ||||
UNIT_ERROR, | ||||
UNIT_MERGED, | ||||
UNIT_MASKED, | ||||
_UNIT_LOAD_STATE_MAX, | ||||
_UNIT_LOAD_STATE_INVALID = -1 | ||||
}; | ||||
const char *unit_type_to_string(UnitType i); | ||||
UnitType unit_type_from_string(const char *s); | ||||
const char *unit_load_state_to_string(UnitLoadState i); | ||||
UnitLoadState unit_load_state_from_string(const char *s); | ||||
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_no_type(const char *n, bool template_ok); | bool unit_name_is_valid(const char *n, bool template_ok); | |||
bool unit_prefix_is_valid(const char *p); | bool unit_prefix_is_valid(const char *p); | |||
bool unit_instance_is_valid(const char *i); | bool unit_instance_is_valid(const char *i); | |||
UnitType unit_name_to_type(const char *n); | ||||
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_build_escape(const char *prefix, const char *instance, cons t char *suffix); | ||||
char *unit_name_escape(const char *f); | char *unit_name_escape(const char *f); | |||
char *unit_name_unescape(const char *f); | char *unit_name_unescape(const char *f); | |||
char *unit_name_path_escape(const char *f); | ||||
char *unit_name_path_unescape(const char *f); | char *unit_name_path_unescape(const char *f); | |||
bool unit_name_is_template(const char *n); | bool unit_name_is_template(const char *n); | |||
char *unit_name_replace_instance(const char *f, const char *i); | char *unit_name_replace_instance(const char *f, const char *i); | |||
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); | |||
#endif | char *unit_dbus_path_from_name(const char *name); | |||
char *unit_name_mangle(const char *name); | ||||
End of changes. 10 change blocks. | ||||
9 lines changed or deleted | 43 lines changed or added | |||
unit.h | unit.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foounithfoo | #pragma once | |||
#define foounithfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <stdlib.h> | #include <stdlib.h> | |||
typedef struct Unit Unit; | typedef struct Unit Unit; | |||
typedef struct UnitVTable UnitVTable; | typedef struct UnitVTable UnitVTable; | |||
typedef enum UnitType UnitType; | ||||
typedef enum UnitLoadState UnitLoadState; | ||||
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; | ||||
#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 "condition.h" | #include "condition.h" | |||
#include "install.h" | #include "install.h" | |||
#include "unit-name.h" | ||||
enum UnitType { | ||||
UNIT_SERVICE = 0, | ||||
UNIT_SOCKET, | ||||
UNIT_TARGET, | ||||
UNIT_DEVICE, | ||||
UNIT_MOUNT, | ||||
UNIT_AUTOMOUNT, | ||||
UNIT_SNAPSHOT, | ||||
UNIT_TIMER, | ||||
UNIT_SWAP, | ||||
UNIT_PATH, | ||||
_UNIT_TYPE_MAX, | ||||
_UNIT_TYPE_INVALID = -1 | ||||
}; | ||||
enum UnitLoadState { | ||||
UNIT_STUB, | ||||
UNIT_LOADED, | ||||
UNIT_ERROR, | ||||
UNIT_MERGED, | ||||
UNIT_MASKED, | ||||
_UNIT_LOAD_STATE_MAX, | ||||
_UNIT_LOAD_STATE_INVALID = -1 | ||||
}; | ||||
enum UnitActiveState { | enum UnitActiveState { | |||
UNIT_ACTIVE, | UNIT_ACTIVE, | |||
UNIT_RELOADING, | UNIT_RELOADING, | |||
UNIT_INACTIVE, | UNIT_INACTIVE, | |||
UNIT_FAILED, | UNIT_FAILED, | |||
UNIT_ACTIVATING, | UNIT_ACTIVATING, | |||
UNIT_DEACTIVATING, | UNIT_DEACTIVATING, | |||
_UNIT_ACTIVE_STATE_MAX, | _UNIT_ACTIVE_STATE_MAX, | |||
_UNIT_ACTIVE_STATE_INVALID = -1 | _UNIT_ACTIVE_STATE_INVALID = -1 | |||
skipping to change at line 103 | skipping to change at line 77 | |||
return t == UNIT_INACTIVE || t == UNIT_FAILED; | return t == UNIT_INACTIVE || t == UNIT_FAILED; | |||
} | } | |||
enum UnitDependency { | enum UnitDependency { | |||
/* Positive dependencies */ | /* Positive dependencies */ | |||
UNIT_REQUIRES, | UNIT_REQUIRES, | |||
UNIT_REQUIRES_OVERRIDABLE, | UNIT_REQUIRES_OVERRIDABLE, | |||
UNIT_REQUISITE, | UNIT_REQUISITE, | |||
UNIT_REQUISITE_OVERRIDABLE, | UNIT_REQUISITE_OVERRIDABLE, | |||
UNIT_WANTS, | UNIT_WANTS, | |||
UNIT_BIND_TO, | UNIT_BINDS_TO, | |||
/* Inverse of the above */ | /* Inverse of the above */ | |||
UNIT_REQUIRED_BY, /* inverse of 'requires' and 'requisi te' is 'required_by' */ | UNIT_REQUIRED_BY, /* inverse of 'requires' and 'requisi te' is 'required_by' */ | |||
UNIT_REQUIRED_BY_OVERRIDABLE, /* inverse of 'requires_overridable' and 'requisite_overridable' is 'soft_required_by' */ | UNIT_REQUIRED_BY_OVERRIDABLE, /* inverse of 'requires_overridable' and 'requisite_overridable' is 'soft_required_by' */ | |||
UNIT_WANTED_BY, /* inverse of 'wants' */ | UNIT_WANTED_BY, /* inverse of 'wants' */ | |||
UNIT_BOUND_BY, /* inverse of 'bind_to' */ | UNIT_BOUND_BY, /* inverse of 'binds_to' */ | |||
/* Negative dependencies */ | /* Negative dependencies */ | |||
UNIT_CONFLICTS, /* inverse of 'conflicts' is 'conflic ted_by' */ | UNIT_CONFLICTS, /* inverse of 'conflicts' is 'conflic ted_by' */ | |||
UNIT_CONFLICTED_BY, | UNIT_CONFLICTED_BY, | |||
/* Order */ | /* Order */ | |||
UNIT_BEFORE, /* inverse of 'before' is 'after' and vice versa */ | UNIT_BEFORE, /* inverse of 'before' is 'after' and vice versa */ | |||
UNIT_AFTER, | UNIT_AFTER, | |||
/* On Failure */ | /* On Failure */ | |||
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_PROPAGATE_RELOAD_TO, | UNIT_PROPAGATES_RELOAD_TO, | |||
UNIT_PROPAGATE_RELOAD_FROM, | UNIT_RELOAD_PROPAGATED_FROM, | |||
/* 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" | |||
skipping to change at line 156 | skipping to change at line 130 | |||
UnitType type; | UnitType type; | |||
UnitLoadState load_state; | UnitLoadState load_state; | |||
Unit *merged_into; | Unit *merged_into; | |||
char *id; /* One name is special because we use it for identificati on. Points to an entry in the names set */ | char *id; /* One name is special because we use it for identificati on. Points to an entry in the names set */ | |||
char *instance; | char *instance; | |||
Set *names; | Set *names; | |||
Set *dependencies[_UNIT_DEPENDENCY_MAX]; | Set *dependencies[_UNIT_DEPENDENCY_MAX]; | |||
char **requires_mounts_for; | ||||
char *description; | char *description; | |||
char **documentation; | ||||
char *fragment_path; /* if loaded from a config file this is the pr imary path to it */ | char *fragment_path; /* if loaded from a config file this is the pr imary path to it */ | |||
char *source_path; /* if converted, the source file */ | ||||
usec_t fragment_mtime; | usec_t fragment_mtime; | |||
usec_t source_mtime; | ||||
/* If there is something to do with this unit, then this is | /* If there is something to do with this unit, then this is the ins | |||
* the job for it */ | talled job for it */ | |||
Job *job; | Job *job; | |||
/* JOB_NOP jobs are special and can be installed without disturbing | ||||
the real job. */ | ||||
Job *nop_job; | ||||
usec_t job_timeout; | usec_t job_timeout; | |||
/* References to this */ | /* References to this */ | |||
LIST_HEAD(UnitRef, refs); | LIST_HEAD(UnitRef, refs); | |||
/* Conditions to check */ | /* Conditions to check */ | |||
LIST_HEAD(Condition, conditions); | LIST_HEAD(Condition, conditions); | |||
dual_timestamp condition_timestamp; | dual_timestamp condition_timestamp; | |||
skipping to change at line 187 | skipping to change at line 168 | |||
dual_timestamp active_exit_timestamp; | dual_timestamp active_exit_timestamp; | |||
dual_timestamp inactive_enter_timestamp; | dual_timestamp inactive_enter_timestamp; | |||
/* Counterparts in the cgroup filesystem */ | /* Counterparts in the cgroup filesystem */ | |||
CGroupBonding *cgroup_bondings; | CGroupBonding *cgroup_bondings; | |||
CGroupAttribute *cgroup_attributes; | CGroupAttribute *cgroup_attributes; | |||
/* 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 */ | ||||
LIST_FIELDS(Unit, has_requires_mounts_for); | ||||
/* Load queue */ | /* Load queue */ | |||
LIST_FIELDS(Unit, load_queue); | LIST_FIELDS(Unit, load_queue); | |||
/* D-Bus queue */ | /* D-Bus queue */ | |||
LIST_FIELDS(Unit, dbus_queue); | LIST_FIELDS(Unit, dbus_queue); | |||
/* Cleanup queue */ | /* Cleanup queue */ | |||
LIST_FIELDS(Unit, cleanup_queue); | LIST_FIELDS(Unit, cleanup_queue); | |||
/* GC queue */ | /* GC queue */ | |||
LIST_FIELDS(Unit, gc_queue); | LIST_FIELDS(Unit, gc_queue); | |||
/* 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 | ||||
* 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) */ | |||
int load_error; | int load_error; | |||
/* Cached unit file state */ | /* Cached unit file state */ | |||
UnitFileState unit_file_state; | UnitFileState unit_file_state; | |||
/* Garbage collect us we nobody wants or requires us anymore */ | /* Garbage collect us we nobody wants or requires us anymore */ | |||
bool stop_when_unneeded; | bool stop_when_unneeded; | |||
skipping to change at line 236 | skipping to change at line 222 | |||
/* Isolate OnFailure unit */ | /* Isolate OnFailure unit */ | |||
bool on_failure_isolate; | bool on_failure_isolate; | |||
/* 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 suceed? */ | /* Did the last condition check succeed? */ | |||
bool condition_result; | bool condition_result; | |||
bool in_load_queue:1; | bool in_load_queue:1; | |||
bool in_dbus_queue:1; | bool in_dbus_queue:1; | |||
bool in_cleanup_queue:1; | bool in_cleanup_queue:1; | |||
bool in_gc_queue:1; | bool in_gc_queue:1; | |||
bool sent_dbus_new_signal:1; | bool sent_dbus_new_signal:1; | |||
bool no_gc:1; | bool no_gc:1; | |||
skipping to change at line 260 | skipping to change at line 246 | |||
struct UnitRef { | struct UnitRef { | |||
/* Keeps tracks of references to a unit. This is useful so | /* Keeps tracks of references to a unit. This is useful so | |||
* that we can merge two units if necessary and correct all | * that we can merge two units if necessary and correct all | |||
* references to them */ | * references to them */ | |||
Unit* unit; | Unit* unit; | |||
LIST_FIELDS(UnitRef, refs); | LIST_FIELDS(UnitRef, refs); | |||
}; | }; | |||
struct UnitStatusMessageFormats { | ||||
const char *starting_stopping[2]; | ||||
const char *finished_start_job[_JOB_RESULT_MAX]; | ||||
const char *finished_stop_job[_JOB_RESULT_MAX]; | ||||
}; | ||||
#include "service.h" | #include "service.h" | |||
#include "timer.h" | #include "timer.h" | |||
#include "socket.h" | #include "socket.h" | |||
#include "target.h" | #include "target.h" | |||
#include "device.h" | #include "device.h" | |||
#include "mount.h" | #include "mount.h" | |||
#include "automount.h" | #include "automount.h" | |||
#include "snapshot.h" | #include "snapshot.h" | |||
#include "swap.h" | #include "swap.h" | |||
#include "path.h" | #include "path.h" | |||
struct UnitVTable { | struct UnitVTable { | |||
const char *suffix; | ||||
/* 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; | |||
/* 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 306 | skipping to change at line 296 | |||
/* If a a lot of units got created via enumerate(), this is | /* If a 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, KillMode m, int signo, DBusError *e rror); | int (*kill)(Unit *u, KillWho w, int signo, DBusError *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 339 | skipping to change at line 329 | |||
* 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); | void (*fd_event)(Unit *u, int fd, uint32_t events, Watch *w); | |||
void (*sigchld_event)(Unit *u, pid_t pid, int code, int status); | void (*sigchld_event)(Unit *u, pid_t pid, int code, int status); | |||
void (*timer_event)(Unit *u, uint64_t n_elapsed, Watch *w); | void (*timer_event)(Unit *u, uint64_t n_elapsed, Watch *w); | |||
/* Check whether unit needs a daemon reload */ | ||||
bool (*need_daemon_reload)(Unit *u); | ||||
/* Reset failed state if we are in failed state */ | /* Reset failed state if we are in failed state */ | |||
void (*reset_failed)(Unit *u); | void (*reset_failed)(Unit *u); | |||
/* Called whenever any of the cgroups this unit watches for | /* Called whenever any of the cgroups this unit watches for | |||
* ran empty */ | * ran empty */ | |||
void (*cgroup_notify_empty)(Unit *u); | void (*cgroup_notify_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); | |||
skipping to change at line 386 | skipping to change at line 373 | |||
void (*shutdown)(Manager *m); | void (*shutdown)(Manager *m); | |||
/* When sending out PropertiesChanged signal, which properties | /* When sending out PropertiesChanged signal, which properties | |||
* shall be invalidated? This is a NUL separated list of | * shall be invalidated? This is a NUL separated list of | |||
* strings, to minimize relocations a little. */ | * strings, to minimize relocations a little. */ | |||
const char *bus_invalidating_properties; | const char *bus_invalidating_properties; | |||
/* The interface name */ | /* The interface name */ | |||
const char *bus_interface; | const char *bus_interface; | |||
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; | |||
/* Show status updates on the console */ | ||||
bool show_status:1; | ||||
}; | }; | |||
extern const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX]; | extern const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX]; | |||
#define UNIT_VTABLE(u) unit_vtable[(u)->type] | #define UNIT_VTABLE(u) unit_vtable[(u)->type] | |||
/* For casting a unit into the various unit types */ | /* For casting a unit into the various unit types */ | |||
#define DEFINE_CAST(UPPERCASE, MixedCase) \ | #define DEFINE_CAST(UPPERCASE, MixedCase) \ | |||
static inline MixedCase* UPPERCASE(Unit *u) { \ | static inline MixedCase* UPPERCASE(Unit *u) { \ | |||
if (_unlikely_(!u || u->type != UNIT_##UPPERCASE)) \ | if (_unlikely_(!u || u->type != UNIT_##UPPERCASE)) \ | |||
skipping to change at line 485 | skipping to change at line 471 | |||
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); | bool unit_can_reload(Unit *u); | |||
bool unit_can_start(Unit *u); | bool unit_can_start(Unit *u); | |||
bool unit_can_isolate(Unit *u); | bool unit_can_isolate(Unit *u); | |||
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, KillMode m, int signo, DBusError *error); | int unit_kill(Unit *u, KillWho w, int signo, DBusError *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); | int unit_watch_fd(Unit *u, int fd, uint32_t events, Watch *w); | |||
void unit_unwatch_fd(Unit *u, 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_timer(Unit *u, usec_t delay, Watch *w); | int unit_watch_timer(Unit *u, usec_t delay, Watch *w); | |||
skipping to change at line 515 | skipping to change at line 501 | |||
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); | int unit_get_related_unit(Unit *u, const char *type, Unit **_found); | |||
char *unit_name_printf(Unit *u, const char* text); | char *unit_name_printf(Unit *u, const char* text); | |||
char *unit_full_printf(Unit *u, const char *text); | char *unit_full_printf(Unit *u, const char *text); | |||
char **unit_full_printf_strv(Unit *u, char **l); | char **unit_full_printf_strv(Unit *u, char **l); | |||
bool unit_can_serialize(Unit *u); | bool unit_can_serialize(Unit *u); | |||
int unit_serialize(Unit *u, FILE *f, FDSet *fds); | 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_attr_(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 *format, .. .); | void unit_status_printf(Unit *u, const char *status, const char *format, .. .); | |||
skipping to change at line 539 | skipping to change at line 525 | |||
Unit *unit_following(Unit *u); | Unit *unit_following(Unit *u); | |||
bool unit_pending_inactive(Unit *u); | bool unit_pending_inactive(Unit *u); | |||
bool unit_pending_active(Unit *u); | bool unit_pending_active(Unit *u); | |||
int unit_add_default_target_dependency(Unit *u, Unit *target); | int unit_add_default_target_dependency(Unit *u, Unit *target); | |||
int unit_following_set(Unit *u, Set **s); | int unit_following_set(Unit *u, Set **s); | |||
UnitType unit_name_to_type(const char *n); | ||||
bool unit_name_is_valid(const char *n, bool template_ok); | ||||
void unit_trigger_on_failure(Unit *u); | void unit_trigger_on_failure(Unit *u); | |||
bool unit_condition_test(Unit *u); | bool unit_condition_test(Unit *u); | |||
UnitFileState unit_get_unit_file_state(Unit *u); | UnitFileState unit_get_unit_file_state(Unit *u); | |||
Unit* unit_ref_set(UnitRef *ref, Unit *u); | Unit* unit_ref_set(UnitRef *ref, Unit *u); | |||
void unit_ref_unset(UnitRef *ref); | void unit_ref_unset(UnitRef *ref); | |||
#define UNIT_DEREF(ref) ((ref).unit) | #define UNIT_DEREF(ref) ((ref).unit) | |||
const char *unit_load_state_to_string(UnitLoadState i); | int unit_add_one_mount_link(Unit *u, Mount *m); | |||
UnitLoadState unit_load_state_from_string(const char *s); | int unit_add_mount_links(Unit *u); | |||
int unit_exec_context_defaults(Unit *u, ExecContext *c); | ||||
const char *unit_active_state_to_string(UnitActiveState i); | const char *unit_active_state_to_string(UnitActiveState i); | |||
UnitActiveState unit_active_state_from_string(const char *s); | UnitActiveState unit_active_state_from_string(const char *s); | |||
const char *unit_dependency_to_string(UnitDependency i); | const char *unit_dependency_to_string(UnitDependency i); | |||
UnitDependency unit_dependency_from_string(const char *s); | UnitDependency unit_dependency_from_string(const char *s); | |||
#endif | ||||
End of changes. 30 change blocks. | ||||
57 lines changed or deleted | 45 lines changed or added | |||
utf8.h | utf8.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooutf8hfoo | #pragma once | |||
#define fooutf8hfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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" | |||
char *utf8_is_valid(const char *s) _pure_; | 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_is_printable_n(const char* str, size_t length) _pure_; | ||||
char *utf8_filter(const char *s); | char *utf8_filter(const char *s); | |||
char *ascii_filter(const char *s); | char *ascii_filter(const char *s); | |||
#endif | ||||
End of changes. 6 change blocks. | ||||
6 lines changed or deleted | 7 lines changed or added | |||
util.h | util.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooutilhfoo | #pragma once | |||
#define fooutilhfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 <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/stat.h> | #include <sys/stat.h> | |||
#include <dirent.h> | #include <dirent.h> | |||
#include <sys/resource.h> | ||||
#include "macro.h" | #include "macro.h" | |||
typedef uint64_t usec_t; | typedef uint64_t usec_t; | |||
typedef uint64_t nsec_t; | ||||
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 1000ULL | |||
#define USEC_PER_SEC 1000000ULL | #define USEC_PER_SEC 1000000ULL | |||
#define USEC_PER_MSEC 1000ULL | #define USEC_PER_MSEC 1000ULL | |||
#define NSEC_PER_SEC 1000000000ULL | #define NSEC_PER_SEC 1000000000ULL | |||
#define NSEC_PER_MSEC 1000000ULL | #define NSEC_PER_MSEC 1000000ULL | |||
#define NSEC_PER_USEC 1000ULL | #define NSEC_PER_USEC 1000ULL | |||
#define USEC_PER_MINUTE (60ULL*USEC_PER_SEC) | #define USEC_PER_MINUTE (60ULL*USEC_PER_SEC) | |||
#define NSEC_PER_MINUTE (60ULL*NSEC_PER_SEC) | ||||
#define USEC_PER_HOUR (60ULL*USEC_PER_MINUTE) | #define USEC_PER_HOUR (60ULL*USEC_PER_MINUTE) | |||
#define NSEC_PER_HOUR (60ULL*NSEC_PER_MINUTE) | ||||
#define USEC_PER_DAY (24ULL*USEC_PER_HOUR) | #define USEC_PER_DAY (24ULL*USEC_PER_HOUR) | |||
#define NSEC_PER_DAY (24ULL*NSEC_PER_HOUR) | ||||
#define USEC_PER_WEEK (7ULL*USEC_PER_DAY) | #define USEC_PER_WEEK (7ULL*USEC_PER_DAY) | |||
#define NSEC_PER_WEEK (7ULL*NSEC_PER_DAY) | ||||
#define USEC_PER_MONTH (2629800ULL*USEC_PER_SEC) | #define USEC_PER_MONTH (2629800ULL*USEC_PER_SEC) | |||
#define NSEC_PER_MONTH (2629800ULL*NSEC_PER_SEC) | ||||
#define USEC_PER_YEAR (31557600ULL*USEC_PER_SEC) | #define USEC_PER_YEAR (31557600ULL*USEC_PER_SEC) | |||
#define NSEC_PER_YEAR (31557600ULL*NSEC_PER_SEC) | ||||
/* 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 "#;\n" | #define COMMENTS "#;\n" | |||
#define FORMAT_TIMESTAMP_MAX 64 | #define FORMAT_TIMESTAMP_MAX 64 | |||
#define FORMAT_TIMESTAMP_PRETTY_MAX 256 | #define FORMAT_TIMESTAMP_PRETTY_MAX 256 | |||
#define FORMAT_TIMESPAN_MAX 64 | #define FORMAT_TIMESPAN_MAX 64 | |||
#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_HIGHLIGHT_RED_ON "\x1B[1;31m" | #define ANSI_HIGHLIGHT_RED_ON "\x1B[1;31m" | |||
#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_OFF "\x1B[0m" | #define ANSI_HIGHLIGHT_OFF "\x1B[0m" | |||
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); | |||
#define dual_timestamp_is_set(ts) ((ts)->realtime > 0) | #define dual_timestamp_is_set(ts) ((ts)->realtime > 0) | |||
usec_t timespec_load(const struct timespec *ts); | usec_t timespec_load(const struct timespec *ts); | |||
skipping to change at line 102 | skipping to change at line 110 | |||
#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) | |||
bool streq_ptr(const char *a, const char *b); | bool streq_ptr(const char *a, const char *b); | |||
#define new(t, n) ((t*) malloc(sizeof(t)*(n))) | #define new(t, n) ((t*) malloc(sizeof(t)*(n))) | |||
#define new0(t, n) ((t*) calloc((n), sizeof(t))) | #define new0(t, n) ((t*) calloc((n), sizeof(t))) | |||
#define newa(t, n) ((t*) alloca(sizeof(t)*(n))) | ||||
#define newdup(t, p, n) ((t*) memdup(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* 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"; | |||
} | } | |||
static inline bool is_path_absolute(const char *p) { | ||||
return *p == '/'; | ||||
} | ||||
static inline bool isempty(const char *p) { | static inline bool isempty(const char *p) { | |||
return !p || !p[0]; | return !p || !p[0]; | |||
} | } | |||
bool endswith(const char *s, const char *postfix); | bool endswith(const char *s, const char *postfix); | |||
bool startswith(const char *s, const char *prefix); | bool startswith(const char *s, const char *prefix); | |||
bool startswith_no_case(const char *s, const char *prefix); | bool startswith_no_case(const char *s, const char *prefix); | |||
bool first_word(const char *s, const char *word); | bool first_word(const char *s, const char *word); | |||
int close_nointr(int fd); | int close_nointr(int fd); | |||
void close_nointr_nofail(int fd); | void close_nointr_nofail(int fd); | |||
void close_many(const int fds[], unsigned n_fd); | void close_many(const int fds[], unsigned n_fd); | |||
int parse_boolean(const char *v); | int parse_boolean(const char *v); | |||
int parse_usec(const char *t, usec_t *usec); | int parse_usec(const char *t, usec_t *usec); | |||
int parse_nsec(const char *t, nsec_t *nsec); | ||||
int parse_bytes(const char *t, off_t *bytes); | 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 203 | skipping to change at line 212 | |||
#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))) | for ((state) = NULL, (word) = split((s), &(length), WHITESPACE, &(s tate)); (word); (word) = split((s), &(length), WHITESPACE, &(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))) | for ((state) = NULL, (word) = split((s), &(length), (separator), &( state)); (word); (word) = split((s), &(length), (separator), &(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) ); (word); (word) = split_quoted((s), &(length), &(state))) | for ((state) = NULL, (word) = split_quoted((s), &(length), &(state) ); (word); (word) = split_quoted((s), &(length), &(state))) | |||
char **split_path_and_make_absolute(const char *p); | ||||
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); | |||
int write_one_line_file(const char *fn, const char *line); | int write_one_line_file(const char *fn, const char *line); | |||
int write_one_line_file_atomic(const char *fn, const char *line); | int write_one_line_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 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, char ***l); | int load_env_file(const char *fname, char ***l); | |||
skipping to change at line 227 | skipping to change at line 234 | |||
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 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); | |||
char *file_name_from_path(const char *p); | ||||
bool is_path(const char *p); | ||||
bool path_is_absolute(const char *p); | ||||
char *path_make_absolute(const char *p, const char *prefix); | ||||
char *path_make_absolute_cwd(const char *p); | ||||
char **strv_path_make_absolute_cwd(char **l); | ||||
char **strv_path_canonicalize(char **l); | ||||
char **strv_path_remove_empty(char **l); | ||||
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 safe_mkdir(const char *path, mode_t mode, uid_t uid, gid_t gid); | ||||
int mkdir_parents(const char *path, mode_t mode); | ||||
int mkdir_p(const char *path, mode_t mode); | ||||
int parent_of_path(const char *path, char **parent); | ||||
int rmdir_parents(const char *path, const char *stop); | int rmdir_parents(const char *path, const char *stop); | |||
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); | |||
char hexchar(int x); | char hexchar(int x); | |||
int unhexchar(char c); | int unhexchar(char c); | |||
skipping to change at line 274 | skipping to change at line 265 | |||
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 *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_escape(const char *s); | |||
char *bus_path_unescape(const char *s); | char *bus_path_unescape(const char *s); | |||
char *path_kill_slashes(char *path); | ||||
bool path_startswith(const char *path, const char *prefix); | ||||
bool path_equal(const char *a, const char *b); | ||||
char *ascii_strlower(char *path); | char *ascii_strlower(char *path); | |||
bool dirent_is_file(const struct dirent *de); | bool dirent_is_file(const struct dirent *de); | |||
bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix ); | bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix ); | |||
bool ignore_file(const char *filename); | bool ignore_file(const char *filename); | |||
bool chars_intersect(const char *a, const char *b); | bool chars_intersect(const char *a, const char *b); | |||
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_pretty(char *buf, size_t l, usec_t t); | char *format_timestamp_pretty(char *buf, size_t l, usec_t t); | |||
char *format_timespan(char *buf, size_t l, usec_t t); | char *format_timespan(char *buf, size_t l, usec_t t); | |||
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); | ||||
unsigned long long random_ull(void); | unsigned long long random_ull(void); | |||
#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) { \ | |||
skipping to change at line 337 | skipping to change at line 324 | |||
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, ...); | int ask(char *ret, const char *replies, const char *text, ...); | |||
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); | 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 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); | |||
int path_is_mount_point(const char *path, bool allow_symlink); | ||||
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); | |||
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, ...); | |||
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); | ||||
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); | |||
int get_ctty_devnr(pid_t pid, dev_t *d); | int get_ctty_devnr(pid_t pid, dev_t *d); | |||
int get_ctty(pid_t, dev_t *_devnr, char **r); | int get_ctty(pid_t, dev_t *_devnr, char **r); | |||
int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid); | int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid); | |||
int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid); | int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid); | |||
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(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 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); | |||
void status_vprintf(const char *status, bool ellipse, const char *format, v a_list ap); | void status_vprintf(const char *status, bool ellipse, const char *format, v a_list ap); | |||
void status_printf(const char *status, bool ellipse, const char *format, .. .); | void status_printf(const char *status, bool ellipse, const char *format, .. .); | |||
void status_welcome(void); | void status_welcome(void); | |||
int fd_columns(int fd); | int fd_columns(int fd); | |||
skipping to change at line 415 | skipping to change at line 406 | |||
bool null_or_empty(struct stat *st); | bool null_or_empty(struct stat *st); | |||
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); | |||
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); | |||
char *fstab_node_to_udev_node(const char *p); | char *fstab_node_to_udev_node(const char *p); | |||
void filter_environ(const char *prefix); | ||||
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); | ||||
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, 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); | |||
void parse_syslog_priority(char **p, int *priority); | void parse_syslog_priority(char **p, int *priority); | |||
void skip_syslog_pid(char **buf); | void skip_syslog_pid(char **buf); | |||
void skip_syslog_date(char **buf); | void skip_syslog_date(char **buf); | |||
int have_effective_cap(int value); | ||||
bool hostname_is_valid(const char *s); | bool hostname_is_valid(const char *s); | |||
char* hostname_cleanup(char *s); | char* hostname_cleanup(char *s); | |||
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 copy_file(const char *from, const char *to); | |||
int symlink_or_copy(const char *from, const char *to); | int symlink_or_copy(const char *from, const char *to); | |||
int symlink_or_copy_atomic(const char *from, const char *to); | int symlink_or_copy_atomic(const char *from, const char *to); | |||
int fchmod_umask(int fd, mode_t mode); | int fchmod_umask(int fd, mode_t mode); | |||
int conf_files_list(char ***strv, const char *suffix, const char *dir, ...) | ||||
; | ||||
int hwclock_is_localtime(void); | ||||
int hwclock_apply_localtime_delta(int *min); | ||||
int hwclock_reset_localtime_delta(void); | ||||
int hwclock_get_time(struct tm *tm); | ||||
int hwclock_set_time(const struct tm *tm); | ||||
int audit_session_from_pid(pid_t pid, uint32_t *id); | ||||
int audit_loginuid_from_pid(pid_t pid, uid_t *uid); | ||||
bool display_is_local(const char *display); | bool display_is_local(const char *display); | |||
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); | 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_group(const char *name); | int in_group(const char *name); | |||
int glob_exists(const char *path); | int glob_exists(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 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 *join(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); | bool in_charset(const char *s, const char* charset); | |||
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); | |||
skipping to change at line 529 | skipping to change at line 506 | |||
int signal_from_string_try_harder(const char *s); | int signal_from_string_try_harder(const char *s); | |||
extern int saved_argc; | extern int saved_argc; | |||
extern char **saved_argv; | extern char **saved_argv; | |||
bool kexec_loaded(void); | bool kexec_loaded(void); | |||
int prot_from_flags(int flags); | int prot_from_flags(int flags); | |||
unsigned long cap_last_cap(void); | ||||
char *format_bytes(char *buf, size_t l, off_t t); | char *format_bytes(char *buf, size_t l, off_t t); | |||
int fd_wait_for_event(int fd, int event, usec_t timeout); | int fd_wait_for_event(int fd, int event, usec_t timeout); | |||
void* memdup(const void *p, size_t l); | void* memdup(const void *p, size_t l); | |||
int rtc_open(int flags); | ||||
int is_kernel_thread(pid_t pid); | int is_kernel_thread(pid_t pid); | |||
int fd_inc_sndbuf(int fd, size_t n); | int fd_inc_sndbuf(int fd, size_t n); | |||
int fd_inc_rcvbuf(int fd, size_t n); | int fd_inc_rcvbuf(int fd, size_t n); | |||
#endif | int fork_agent(pid_t *pid, const int except[], unsigned n_except, const cha | |||
r *path, ...); | ||||
int setrlimit_closest(int resource, const struct rlimit *rlim); | ||||
int getenv_for_pid(pid_t pid, const char *field, char **_value); | ||||
int can_sleep(const char *type); | ||||
bool is_valid_documentation_url(const char *url); | ||||
bool in_initrd(void); | ||||
void warn_melody(void); | ||||
int get_shell(char **ret); | ||||
int get_home_dir(char **ret); | ||||
End of changes. 36 change blocks. | ||||
58 lines changed or deleted | 32 lines changed or added | |||
utmp-wtmp.h | utmp-wtmp.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef fooutmpwtmphfoo | #pragma once | |||
#define fooutmpwtmphfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 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, bool (*match_tty)(const char *tty)); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
virt.h | virt.h | |||
---|---|---|---|---|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | |||
#ifndef foovirthfoo | #pragma once | |||
#define foovirthfoo | ||||
/*** | /*** | |||
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 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 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 | |||
General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU 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 { | typedef enum Virtualization { | |||
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; | |||
Virtualization detect_virtualization(const char **id); | Virtualization detect_virtualization(const char **id); | |||
#endif | ||||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||