automount.h | automount.h | |||
---|---|---|---|---|
skipping to change at line 51 | skipping to change at line 51 | |||
_AUTOMOUNT_RESULT_INVALID = -1 | _AUTOMOUNT_RESULT_INVALID = -1 | |||
} AutomountResult; | } AutomountResult; | |||
struct Automount { | struct Automount { | |||
Unit meta; | Unit meta; | |||
AutomountState state, deserialized_state; | AutomountState state, deserialized_state; | |||
char *where; | char *where; | |||
UnitRef mount; | ||||
int pipe_fd; | int pipe_fd; | |||
mode_t directory_mode; | mode_t directory_mode; | |||
Watch pipe_watch; | Watch pipe_watch; | |||
dev_t dev_id; | dev_t dev_id; | |||
Set *tokens; | Set *tokens; | |||
AutomountResult result; | AutomountResult result; | |||
}; | }; | |||
extern const UnitVTable automount_vtable; | extern const UnitVTable automount_vtable; | |||
int automount_send_ready(Automount *a, int status); | int automount_send_ready(Automount *a, int status); | |||
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) _const_; | |||
AutomountState automount_state_from_string(const char *s); | AutomountState automount_state_from_string(const char *s) _pure_; | |||
const char* automount_result_to_string(AutomountResult i); | const char* automount_result_to_string(AutomountResult i) _const_; | |||
AutomountResult automount_result_from_string(const char *s); | AutomountResult automount_result_from_string(const char *s) _pure_; | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 2 lines changed or added | |||
bootchart.h | bootchart.h | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
WITHOUT ANY WARRANTY; without even the implied warranty of | WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#include <dirent.h> | #include <dirent.h> | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include "list.h" | ||||
#define MAXCPUS 16 | #define MAXCPUS 16 | |||
#define MAXPIDS 65535 | #define MAXPIDS 65535 | |||
#define MAXSAMPLES 8192 | ||||
struct block_stat_struct { | struct block_stat_struct { | |||
/* /proc/vmstat pgpgin & pgpgout */ | /* /proc/vmstat pgpgin & pgpgout */ | |||
int bi; | int bi; | |||
int bo; | int bo; | |||
}; | }; | |||
struct cpu_stat_sample_struct { | struct cpu_stat_sample_struct { | |||
/* /proc/schedstat fields 10 & 11 (after name) */ | /* /proc/schedstat fields 10 & 11 (after name) */ | |||
double runtime; | double runtime; | |||
double waittime; | double waittime; | |||
}; | }; | |||
struct cpu_stat_struct { | ||||
/* per cpu array */ | ||||
struct cpu_stat_sample_struct sample[MAXSAMPLES]; | ||||
}; | ||||
/* per process, per sample data we will log */ | /* per process, per sample data we will log */ | |||
struct ps_sched_struct { | struct ps_sched_struct { | |||
/* /proc/<n>/schedstat fields 1 & 2 */ | /* /proc/<n>/schedstat fields 1 & 2 */ | |||
double runtime; | double runtime; | |||
double waittime; | double waittime; | |||
int pss; | int pss; | |||
struct list_sample_data *sampledata; | ||||
struct ps_sched_struct *next; | ||||
struct ps_sched_struct *prev; | ||||
struct ps_sched_struct *cross; /* cross pointer */ | ||||
struct ps_struct *ps_new; | ||||
}; | ||||
struct list_sample_data { | ||||
double runtime[MAXCPUS]; | ||||
double waittime[MAXCPUS]; | ||||
double sampletime; | ||||
int entropy_avail; | ||||
struct block_stat_struct blockstat; | ||||
LIST_FIELDS(struct list_sample_data, link); /* DLL */ | ||||
int counter; | ||||
}; | }; | |||
/* process info */ | /* process info */ | |||
struct ps_struct { | struct ps_struct { | |||
struct ps_struct *next_ps; /* SLL pointer */ | struct ps_struct *next_ps; /* SLL pointer */ | |||
struct ps_struct *parent; /* ppid ref */ | struct ps_struct *parent; /* ppid ref */ | |||
struct ps_struct *children; /* children */ | struct ps_struct *children; /* children */ | |||
struct ps_struct *next; /* siblings */ | struct ps_struct *next; /* siblings */ | |||
/* must match - otherwise it's a new process with same PID */ | /* must match - otherwise it's a new process with same PID */ | |||
char name[256]; | char name[256]; | |||
int pid; | int pid; | |||
int ppid; | int ppid; | |||
/* cache fd's */ | /* cache fd's */ | |||
int sched; | int sched; | |||
int schedstat; | int schedstat; | |||
FILE *smaps; | FILE *smaps; | |||
/* index to first/last seen timestamps */ | /* pointers to first/last seen timestamps */ | |||
int first; | struct ps_sched_struct *first; | |||
int last; | struct ps_sched_struct *last; | |||
/* records actual start time, may be way before bootchart runs */ | /* records actual start time, may be way before bootchart runs */ | |||
double starttime; | double starttime; | |||
/* record human readable total cpu time */ | /* record human readable total cpu time */ | |||
double total; | double total; | |||
/* largest PSS size found */ | /* largest PSS size found */ | |||
int pss_max; | int pss_max; | |||
skipping to change at line 103 | skipping to change at line 113 | |||
struct ps_sched_struct *sample; | struct ps_sched_struct *sample; | |||
}; | }; | |||
extern int entropy_avail[]; | extern int entropy_avail[]; | |||
extern double graph_start; | extern double graph_start; | |||
extern double log_start; | extern double log_start; | |||
extern double sampletime[]; | extern double sampletime[]; | |||
extern struct ps_struct *ps_first; | extern struct ps_struct *ps_first; | |||
extern struct block_stat_struct blockstat[]; | extern struct block_stat_struct blockstat[]; | |||
extern struct cpu_stat_struct cpustat[]; | ||||
extern int pscount; | extern int pscount; | |||
extern bool arg_relative; | extern bool arg_relative; | |||
extern bool arg_filter; | extern bool arg_filter; | |||
extern bool arg_show_cmdline; | extern bool arg_show_cmdline; | |||
extern bool arg_pss; | extern bool arg_pss; | |||
extern bool arg_entropy; | extern bool arg_entropy; | |||
extern bool initcall; | extern bool initcall; | |||
extern int samples; | extern int samples; | |||
extern int cpus; | extern int cpus; | |||
extern int arg_samples_len; | extern int arg_samples_len; | |||
End of changes. 6 change blocks. | ||||
10 lines changed or deleted | 19 lines changed or added | |||
bus-message.h | bus-message.h | |||
---|---|---|---|---|
skipping to change at line 122 | skipping to change at line 122 | |||
const char *tid_comm; | const char *tid_comm; | |||
const char *cgroup; | const char *cgroup; | |||
const char *cmdline; | const char *cmdline; | |||
size_t cmdline_length; | size_t cmdline_length; | |||
char **cmdline_array; | char **cmdline_array; | |||
char *session; | char *session; | |||
char *unit; | char *unit; | |||
char *user_unit; | char *user_unit; | |||
struct kdbus_audit *audit; | ||||
uint8_t *capability; | ||||
size_t capability_size; | ||||
}; | }; | |||
#define BUS_MESSAGE_NEED_BSWAP(m) ((m)->header->endian != SD_BUS_NATIVE_END IAN) | #define BUS_MESSAGE_NEED_BSWAP(m) ((m)->header->endian != SD_BUS_NATIVE_END IAN) | |||
static inline uint16_t BUS_MESSAGE_BSWAP16(sd_bus_message *m, uint16_t u) { | static inline uint16_t BUS_MESSAGE_BSWAP16(sd_bus_message *m, uint16_t u) { | |||
return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_16(u) : u; | return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_16(u) : u; | |||
} | } | |||
static inline uint32_t BUS_MESSAGE_BSWAP32(sd_bus_message *m, uint32_t u) { | static inline uint32_t BUS_MESSAGE_BSWAP32(sd_bus_message *m, uint32_t u) { | |||
return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_32(u) : u; | return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_32(u) : u; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 5 lines changed or added | |||
catalog.h | catalog.h | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include "sd-id128.h" | #include "sd-id128.h" | |||
#include "hashmap.h" | #include "hashmap.h" | |||
#include "strbuf.h" | #include "strbuf.h" | |||
int catalog_import_file(Hashmap *h, struct strbuf *sb, const char *path); | int catalog_import_file(Hashmap *h, struct strbuf *sb, const char *path); | |||
unsigned catalog_hash_func(const void *p); | unsigned catalog_hash_func(const void *p); | |||
int catalog_compare_func(const void *a, const void *b); | int catalog_compare_func(const void *a, const void *b) _pure_; | |||
int catalog_update(const char* database, const char* root, const char* cons t* dirs); | int catalog_update(const char* database, const char* root, const char* cons t* dirs); | |||
int catalog_get(const char* database, sd_id128_t id, char **data); | int catalog_get(const char* database, sd_id128_t id, char **data); | |||
int catalog_list(FILE *f, const char* database, bool oneline); | int catalog_list(FILE *f, const char* database, bool oneline); | |||
int catalog_list_items(FILE *f, const char* database, bool oneline, char ** items); | int catalog_list_items(FILE *f, const char* database, bool oneline, char ** items); | |||
extern const char * const catalog_file_dirs[]; | extern const char * const catalog_file_dirs[]; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
cgroup-attr.h | cgroup-attr.h | |||
---|---|---|---|---|
skipping to change at line 45 | skipping to change at line 45 | |||
Unit *unit; | Unit *unit; | |||
const CGroupSemantics *semantics; | const CGroupSemantics *semantics; | |||
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); | |||
bool cgroup_attribute_matches(CGroupAttribute *a, const char *controller, c | bool cgroup_attribute_matches(CGroupAttribute *a, const char *controller, c | |||
onst char *name); | onst char *name) _pure_; | |||
CGroupAttribute *cgroup_attribute_find_list(CGroupAttribute *first, const c | CGroupAttribute *cgroup_attribute_find_list(CGroupAttribute *first, const c | |||
har *controller, const char *name); | har *controller, const char *name) _pure_; | |||
void cgroup_attribute_free(CGroupAttribute *a); | void cgroup_attribute_free(CGroupAttribute *a); | |||
void cgroup_attribute_free_list(CGroupAttribute *first); | void cgroup_attribute_free_list(CGroupAttribute *first); | |||
void cgroup_attribute_free_some(CGroupAttribute *first, const char *control ler, const char *name); | void cgroup_attribute_free_some(CGroupAttribute *first, const char *control ler, const char *name); | |||
End of changes. 1 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
cgroup-util.h | cgroup-util.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#include <dirent.h> | #include <dirent.h> | |||
#include "set.h" | #include "set.h" | |||
#include "def.h" | #include "def.h" | |||
/* | ||||
* General rules: | ||||
* | ||||
* We accept named hierarchies in the syntax "foo" and "name=foo". | ||||
* | ||||
* We expect that named hierarchies do not conflict in name with a | ||||
* kernel hierarchy, modulo the "name=" prefix. | ||||
* | ||||
* We always generate "normalized" controller names, i.e. without the | ||||
* "name=" prefix. | ||||
* | ||||
* We require absolute cgroup paths. When returning, we will always | ||||
* generate paths with multiple adjacent / removed. | ||||
*/ | ||||
int cg_enumerate_processes(const char *controller, const char *path, FILE * *_f); | int cg_enumerate_processes(const char *controller, const char *path, FILE * *_f); | |||
int cg_enumerate_tasks(const char *controller, const char *path, FILE **_f) ; | int cg_enumerate_tasks(const char *controller, const char *path, FILE **_f) ; | |||
int cg_read_pid(FILE *f, pid_t *_pid); | int cg_read_pid(FILE *f, pid_t *_pid); | |||
int cg_enumerate_subgroups(const char *controller, const char *path, DIR ** _d); | int cg_enumerate_subgroups(const char *controller, const char *path, DIR ** _d); | |||
int cg_read_subgroup(DIR *d, char **fn); | int cg_read_subgroup(DIR *d, char **fn); | |||
int cg_kill(const char *controller, const char *path, int sig, bool sigcont , bool ignore_self, Set *s); | int cg_kill(const char *controller, const char *path, int sig, bool sigcont , bool ignore_self, Set *s); | |||
int cg_kill_recursive(const char *controller, const char *path, int sig, bo ol sigcont, bool ignore_self, bool remove, Set *s); | int cg_kill_recursive(const char *controller, const char *path, int sig, bo ol sigcont, bool ignore_self, bool remove, Set *s); | |||
int cg_kill_recursive_and_wait(const char *controller, const char *path, bo ol remove); | int cg_kill_recursive_and_wait(const char *controller, const char *path, bo ol remove); | |||
skipping to change at line 75 | skipping to change at line 90 | |||
int cg_install_release_agent(const char *controller, const char *agent); | int cg_install_release_agent(const char *controller, const char *agent); | |||
int cg_is_empty(const char *controller, const char *path, bool ignore_self) ; | int cg_is_empty(const char *controller, const char *path, bool ignore_self) ; | |||
int cg_is_empty_by_spec(const char *spec, bool ignore_self); | int cg_is_empty_by_spec(const char *spec, bool ignore_self); | |||
int cg_is_empty_recursive(const char *controller, const char *path, bool ig nore_self); | int cg_is_empty_recursive(const char *controller, const char *path, bool ig nore_self); | |||
int cg_get_root_path(char **path); | int cg_get_root_path(char **path); | |||
int cg_get_system_path(char **path); | int cg_get_system_path(char **path); | |||
int cg_get_user_path(char **path); | int cg_get_user_path(char **path); | |||
int cg_get_machine_path(char **path); | int cg_get_machine_path(const char *machine, char **path); | |||
int cg_path_get_session(const char *path, char **session); | int cg_path_get_session(const char *path, char **session); | |||
int cg_path_get_owner_uid(const char *path, uid_t *uid); | ||||
int cg_path_get_unit(const char *path, char **unit); | int cg_path_get_unit(const char *path, char **unit); | |||
int cg_path_get_user_unit(const char *path, char **unit); | int cg_path_get_user_unit(const char *path, char **unit); | |||
int cg_path_get_machine_name(const char *path, char **machine); | int cg_path_get_machine_name(const char *path, char **machine); | |||
int cg_pid_get_path_shifted(pid_t pid, char **root, char **cgroup); | int cg_pid_get_path_shifted(pid_t pid, char **root, char **cgroup); | |||
int cg_pid_get_session(pid_t pid, char **session); | int cg_pid_get_session(pid_t pid, char **session); | |||
int cg_pid_get_owner_uid(pid_t pid, uid_t *uid); | ||||
int cg_pid_get_unit(pid_t pid, char **unit); | int cg_pid_get_unit(pid_t pid, char **unit); | |||
int cg_pid_get_user_unit(pid_t pid, char **unit); | int cg_pid_get_user_unit(pid_t pid, char **unit); | |||
int cg_pid_get_machine_name(pid_t pid, char **machine); | int cg_pid_get_machine_name(pid_t pid, char **machine); | |||
int cg_path_decode_unit(const char *cgroup, char **unit); | int cg_path_decode_unit(const char *cgroup, char **unit); | |||
char **cg_shorten_controllers(char **controllers); | char **cg_shorten_controllers(char **controllers); | |||
int cg_controller_from_attr(const char *attr, char **controller); | int cg_controller_from_attr(const char *attr, char **controller); | |||
char *cg_escape(const char *p); | ||||
char *cg_unescape(const char *p) _pure_; | ||||
bool cg_controller_is_valid(const char *p, bool allow_named); | ||||
End of changes. 5 change blocks. | ||||
1 lines changed or deleted | 18 lines changed or added | |||
cgroup.h | cgroup.h | |||
---|---|---|---|---|
skipping to change at line 79 | skipping to change at line 79 | |||
int cgroup_bonding_kill(CGroupBonding *b, int sig, bool sigcont, bool rem, Set *s, const char *suffix); | int cgroup_bonding_kill(CGroupBonding *b, int sig, bool sigcont, bool rem, Set *s, const char *suffix); | |||
int cgroup_bonding_kill_list(CGroupBonding *first, int sig, bool sigcont, b ool rem, Set *s, const char *suffix); | 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) _pure_; | |||
char *cgroup_bonding_to_string(CGroupBonding *b); | char *cgroup_bonding_to_string(CGroupBonding *b); | |||
pid_t cgroup_bonding_search_main_pid(CGroupBonding *b); | pid_t cgroup_bonding_search_main_pid(CGroupBonding *b); | |||
pid_t cgroup_bonding_search_main_pid_list(CGroupBonding *b); | pid_t cgroup_bonding_search_main_pid_list(CGroupBonding *b); | |||
#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); | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
condition.h | condition.h | |||
---|---|---|---|---|
skipping to change at line 69 | skipping to change at line 69 | |||
Condition* condition_new(ConditionType type, const char *parameter, bool tr igger, bool negate); | Condition* condition_new(ConditionType type, const char *parameter, bool tr igger, bool negate); | |||
void condition_free(Condition *c); | void condition_free(Condition *c); | |||
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) _const_; | |||
int condition_type_from_string(const char *s); | int condition_type_from_string(const char *s) _pure_; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
conf-parser.h | conf-parser.h | |||
---|---|---|---|---|
skipping to change at line 90 | skipping to change at line 90 | |||
* ConfigPerfItem tables */ | * ConfigPerfItem tables */ | |||
int config_item_perf_lookup(void *table, const char *section, const char *l value, ConfigParserCallback *func, int *ltype, void **data, void *userdata) ; | int config_item_perf_lookup(void *table, const char *section, const char *l value, ConfigParserCallback *func, int *ltype, void **data, void *userdata) ; | |||
int config_parse(const char *unit, | int config_parse(const char *unit, | |||
const char *filename, | const char *filename, | |||
FILE *f, | FILE *f, | |||
const char *sections, /* nulstr */ | const char *sections, /* nulstr */ | |||
ConfigItemLookup lookup, | ConfigItemLookup lookup, | |||
void *table, | void *table, | |||
bool relaxed, | bool relaxed, | |||
bool allow_include, | ||||
void *userdata); | void *userdata); | |||
/* Generic parsers */ | /* Generic parsers */ | |||
int config_parse_int(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, vo id *data, void *userdata); | int config_parse_int(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, vo id *data, void *userdata); | |||
int config_parse_unsigned(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalu e, void *data, void *userdata); | int config_parse_unsigned(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalu e, void *data, void *userdata); | |||
int config_parse_long(const char *unit, const char *filename, unsigned line , const char *section, const char *lvalue, int ltype, const char *rvalue, v oid *data, void *userdata); | int config_parse_long(const char *unit, const char *filename, unsigned line , const char *section, const char *lvalue, int ltype, const char *rvalue, v oid *data, void *userdata); | |||
int config_parse_uint64(const char *unit, const char *filename, unsigned li ne, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_uint64(const char *unit, const char *filename, unsigned li ne, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_double(const char *unit, const char *filename, unsigned li ne, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_double(const char *unit, const char *filename, unsigned li ne, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_bytes_size(const char *unit, const char *filename, unsigne d line, const char *section, const char *lvalue, int ltype, const char *rva lue, void *data, void *userdata); | int config_parse_bytes_size(const char *unit, const char *filename, unsigne d line, const char *section, const char *lvalue, int ltype, const char *rva lue, void *data, void *userdata); | |||
int config_parse_bytes_off(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rval ue, void *data, void *userdata); | int config_parse_bytes_off(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rval ue, void *data, void *userdata); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
config.h | config.h | |||
---|---|---|---|---|
skipping to change at line 250 | skipping to change at line 250 | |||
/* Name of package */ | /* Name of package */ | |||
#define PACKAGE "systemd" | #define PACKAGE "systemd" | |||
/* Define to the address where bug reports for this package should be sent. */ | /* Define to the address where bug reports for this package should be sent. */ | |||
#define PACKAGE_BUGREPORT "http://bugs.freedesktop.org/enter_bug.cgi?produc t=systemd" | #define PACKAGE_BUGREPORT "http://bugs.freedesktop.org/enter_bug.cgi?produc t=systemd" | |||
/* Define to the full name of this package. */ | /* Define to the full name of this package. */ | |||
#define PACKAGE_NAME "systemd" | #define PACKAGE_NAME "systemd" | |||
/* Define to the full name and version of this package. */ | /* Define to the full name and version of this package. */ | |||
#define PACKAGE_STRING "systemd 202" | #define PACKAGE_STRING "systemd 203" | |||
/* Define to the one symbol short name of this package. */ | /* Define to the one symbol short name of this package. */ | |||
#define PACKAGE_TARNAME "systemd" | #define PACKAGE_TARNAME "systemd" | |||
/* Define to the home page for this package. */ | /* Define to the home page for this package. */ | |||
#define PACKAGE_URL "http://www.freedesktop.org/wiki/Software/systemd" | #define PACKAGE_URL "http://www.freedesktop.org/wiki/Software/systemd" | |||
/* Define to the version of this package. */ | /* Define to the version of this package. */ | |||
#define PACKAGE_VERSION "202" | #define PACKAGE_VERSION "203" | |||
/* Path of /etc/rc.local script */ | /* Path of /etc/rc.local script */ | |||
#define RC_LOCAL_SCRIPT_PATH_START "/etc/rc.local" | #define RC_LOCAL_SCRIPT_PATH_START "/etc/rc.local" | |||
/* Path of /usr/sbin/halt.local script */ | /* Path of /usr/sbin/halt.local script */ | |||
#define RC_LOCAL_SCRIPT_PATH_STOP "/usr/sbin/halt.local" | #define RC_LOCAL_SCRIPT_PATH_STOP "/usr/sbin/halt.local" | |||
/* Define to the type of arg 1 for `select'. */ | /* Define to the type of arg 1 for `select'. */ | |||
#define SELECT_TYPE_ARG1 int | #define SELECT_TYPE_ARG1 int | |||
skipping to change at line 310 | skipping to change at line 310 | |||
/* 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 "202" | #define VERSION "203" | |||
/* Enable large inode numbers on Mac OS X 10.5. */ | /* Enable large inode numbers on Mac OS X 10.5. */ | |||
#ifndef _DARWIN_USE_64_BIT_INODE | #ifndef _DARWIN_USE_64_BIT_INODE | |||
# define _DARWIN_USE_64_BIT_INODE 1 | # define _DARWIN_USE_64_BIT_INODE 1 | |||
#endif | #endif | |||
/* Number of bits in a file offset, on hosts where this is settable. */ | /* Number of bits in a file offset, on hosts where this is settable. */ | |||
#define _FILE_OFFSET_BITS 64 | #define _FILE_OFFSET_BITS 64 | |||
/* Define for large files, on AIX-style hosts. */ | /* Define for large files, on AIX-style hosts. */ | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
dbus-common.h | dbus-common.h | |||
---|---|---|---|---|
skipping to change at line 28 | skipping to change at line 28 | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#include <dbus/dbus.h> | #include <dbus/dbus.h> | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include "macro.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 | |||
#define DBUS_ERROR_UNKNOWN_INTERFACE "org.freedesktop.DBus.Error.UnknownInt erface" | #define DBUS_ERROR_UNKNOWN_INTERFACE "org.freedesktop.DBus.Error.UnknownInt erface" | |||
#endif | #endif | |||
#ifndef DBUS_ERROR_UNKNOWN_PROPERTY | #ifndef DBUS_ERROR_UNKNOWN_PROPERTY | |||
#define DBUS_ERROR_UNKNOWN_PROPERTY "org.freedesktop.DBus.Error.UnknownProp erty" | #define DBUS_ERROR_UNKNOWN_PROPERTY "org.freedesktop.DBus.Error.UnknownProp erty" | |||
skipping to change at line 190 | skipping to change at line 192 | |||
dbus_message_iter_get_basic(i, &value); \ | dbus_message_iter_get_basic(i, &value); \ | |||
\ | \ | |||
f = name##_from_string(value); \ | f = name##_from_string(value); \ | |||
if (f < 0) \ | if (f < 0) \ | |||
return f; \ | return f; \ | |||
\ | \ | |||
*field = f; \ | *field = f; \ | |||
return 0; \ | return 0; \ | |||
} | } | |||
const char *bus_errno_to_dbus(int error); | const char *bus_errno_to_dbus(int error) _const_; | |||
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); | 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) _pure_; | |||
unsigned bus_events_to_flags(uint32_t events); | unsigned bus_events_to_flags(uint32_t events) _const_; | |||
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_parse_strv_pairs_iter(DBusMessageIter *iter, char ***_l); | int bus_parse_strv_pairs_iter(DBusMessageIter *iter, char ***_l); | |||
struct unit_info { | struct unit_info { | |||
const char *id; | const char *id; | |||
const char *description; | const char *description; | |||
const char *load_state; | const char *load_state; | |||
const char *active_state; | const char *active_state; | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 5 lines changed or added | |||
dbus-execute.h | dbus-execute.h | |||
---|---|---|---|---|
skipping to change at line 40 | skipping to change at line 40 | |||
" <property name=\"" prefix "StartTimestamp\" type=\"t\" access=\" read\"/>\n" \ | " <property name=\"" prefix "StartTimestamp\" type=\"t\" access=\" read\"/>\n" \ | |||
" <property name=\"" prefix "StartTimestampMonotonic\" type=\"t\" access=\"read\"/>\n" \ | " <property name=\"" prefix "StartTimestampMonotonic\" type=\"t\" access=\"read\"/>\n" \ | |||
" <property name=\"" prefix "ExitTimestamp\" type=\"t\" access=\"r ead\"/>\n" \ | " <property name=\"" prefix "ExitTimestamp\" type=\"t\" access=\"r ead\"/>\n" \ | |||
" <property name=\"" prefix "ExitTimestampMonotonic\" type=\"t\" a ccess=\"read\"/>\n" \ | " <property name=\"" prefix "ExitTimestampMonotonic\" type=\"t\" a ccess=\"read\"/>\n" \ | |||
" <property name=\"" prefix "PID\" type=\"u\" access=\"read\"/>\n" \ | " <property name=\"" prefix "PID\" type=\"u\" access=\"read\"/>\n" \ | |||
" <property name=\"" prefix "Code\" type=\"i\" access=\"read\"/>\n " \ | " <property name=\"" prefix "Code\" type=\"i\" access=\"read\"/>\n " \ | |||
" <property name=\"" prefix "Status\" type=\"i\" access=\"read\"/> \n" | " <property name=\"" prefix "Status\" type=\"i\" access=\"read\"/> \n" | |||
#define BUS_EXEC_CONTEXT_INTERFACE \ | #define BUS_EXEC_CONTEXT_INTERFACE \ | |||
" <property name=\"Environment\" type=\"as\" access=\"read\"/>\n" \ | " <property name=\"Environment\" type=\"as\" access=\"read\"/>\n" \ | |||
" <property name=\"EnvironmentFiles\" type=\"a(sb)\" access=\"read \"/>\n" \ | ||||
" <property name=\"UMask\" type=\"u\" access=\"read\"/>\n" \ | " <property name=\"UMask\" type=\"u\" access=\"read\"/>\n" \ | |||
" <property name=\"LimitCPU\" type=\"t\" access=\"read\"/>\n" \ | " <property name=\"LimitCPU\" type=\"t\" access=\"read\"/>\n" \ | |||
" <property name=\"LimitFSIZE\" type=\"t\" access=\"read\"/>\n" \ | " <property name=\"LimitFSIZE\" type=\"t\" access=\"read\"/>\n" \ | |||
" <property name=\"LimitDATA\" type=\"t\" access=\"read\"/>\n" \ | " <property name=\"LimitDATA\" type=\"t\" access=\"read\"/>\n" \ | |||
" <property name=\"LimitSTACK\" type=\"t\" access=\"read\"/>\n" \ | " <property name=\"LimitSTACK\" type=\"t\" access=\"read\"/>\n" \ | |||
" <property name=\"LimitCORE\" type=\"t\" access=\"read\"/>\n" \ | " <property name=\"LimitCORE\" type=\"t\" access=\"read\"/>\n" \ | |||
" <property name=\"LimitRSS\" type=\"t\" access=\"read\"/>\n" \ | " <property name=\"LimitRSS\" type=\"t\" access=\"read\"/>\n" \ | |||
" <property name=\"LimitNOFILE\" type=\"t\" access=\"read\"/>\n" \ | " <property name=\"LimitNOFILE\" type=\"t\" access=\"read\"/>\n" \ | |||
" <property name=\"LimitAS\" type=\"t\" access=\"read\"/>\n" \ | " <property name=\"LimitAS\" type=\"t\" access=\"read\"/>\n" \ | |||
" <property name=\"LimitNPROC\" type=\"t\" access=\"read\"/>\n" \ | " <property name=\"LimitNPROC\" type=\"t\" access=\"read\"/>\n" \ | |||
skipping to change at line 91 | skipping to change at line 92 | |||
" <property name=\"User\" type=\"s\" access=\"read\"/>\n" \ | " <property name=\"User\" type=\"s\" access=\"read\"/>\n" \ | |||
" <property name=\"Group\" type=\"s\" access=\"read\"/>\n" \ | " <property name=\"Group\" type=\"s\" access=\"read\"/>\n" \ | |||
" <property name=\"SupplementaryGroups\" type=\"as\" access=\"read \"/>\n" \ | " <property name=\"SupplementaryGroups\" type=\"as\" access=\"read \"/>\n" \ | |||
" <property name=\"TCPWrapName\" type=\"s\" access=\"read\"/>\n" \ | " <property name=\"TCPWrapName\" type=\"s\" access=\"read\"/>\n" \ | |||
" <property name=\"PAMName\" type=\"s\" access=\"read\"/>\n" \ | " <property name=\"PAMName\" type=\"s\" access=\"read\"/>\n" \ | |||
" <property name=\"ReadWriteDirectories\" type=\"as\" access=\"rea d\"/>\n" \ | " <property name=\"ReadWriteDirectories\" type=\"as\" access=\"rea d\"/>\n" \ | |||
" <property name=\"ReadOnlyDirectories\" type=\"as\" access=\"read \"/>\n" \ | " <property name=\"ReadOnlyDirectories\" type=\"as\" access=\"read \"/>\n" \ | |||
" <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=\"PrivateNetwork\" 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=\"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=\"IgnoreSIGPIPE\" type=\"b\" access=\"read\"/>\n" \ | " <property name=\"IgnoreSIGPIPE\" type=\"b\" access=\"read\"/>\n" \ | |||
" <property name=\"NoNewPrivileges\" type=\"b\" access=\"read\"/>\ n" \ | " <property name=\"NoNewPrivileges\" type=\"b\" access=\"read\"/>\ n" \ | |||
" <property name=\"SystemCallFilter\" type=\"au\" 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) \ | |||
End of changes. 4 change blocks. | ||||
3 lines changed or deleted | 2 lines changed or added | |||
device.h | device.h | |||
---|---|---|---|---|
skipping to change at line 55 | skipping to change at line 55 | |||
LIST_FIELDS(struct Device, same_sysfs); | LIST_FIELDS(struct Device, same_sysfs); | |||
DeviceState state; | DeviceState state; | |||
}; | }; | |||
extern const UnitVTable device_vtable; | extern const UnitVTable device_vtable; | |||
void device_fd_event(Manager *m, int events); | void device_fd_event(Manager *m, int events); | |||
const char* device_state_to_string(DeviceState i); | const char* device_state_to_string(DeviceState i) _const_; | |||
DeviceState device_state_from_string(const char *s); | DeviceState device_state_from_string(const char *s) _pure_; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
env-util.h | env-util.h | |||
---|---|---|---|---|
skipping to change at line 43 | skipping to change at line 43 | |||
char **strv_env_clean_log(char **e, const char *message); | char **strv_env_clean_log(char **e, const char *message); | |||
bool strv_env_name_or_assignment_is_valid(char **l); | bool strv_env_name_or_assignment_is_valid(char **l); | |||
char **strv_env_merge(unsigned n_lists, ...); | char **strv_env_merge(unsigned n_lists, ...); | |||
char **strv_env_delete(char **x, unsigned n_lists, ...); /* New copy */ | char **strv_env_delete(char **x, unsigned n_lists, ...); /* New copy */ | |||
char **strv_env_set(char **x, const char *p); /* New copy ... */ | char **strv_env_set(char **x, const char *p); /* New copy ... */ | |||
char **strv_env_unset(char **l, const char *p); /* In place ... */ | char **strv_env_unset(char **l, const char *p); /* In place ... */ | |||
char *strv_env_get_n(char **l, const char *name, size_t k); | char *strv_env_get_n(char **l, const char *name, size_t k) _pure_; | |||
char *strv_env_get(char **x, const char *n); | char *strv_env_get(char **x, const char *n) _pure_; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
execute.h | execute.h | |||
---|---|---|---|---|
skipping to change at line 213 | skipping to change at line 213 | |||
int exec_context_load_environment(const ExecContext *c, char ***l); | int exec_context_load_environment(const ExecContext *c, char ***l); | |||
bool exec_context_may_touch_console(ExecContext *c); | bool exec_context_may_touch_console(ExecContext *c); | |||
void exec_context_serialize(const ExecContext *c, Unit *u, FILE *f); | void exec_context_serialize(const ExecContext *c, Unit *u, FILE *f); | |||
void exec_status_start(ExecStatus *s, pid_t pid); | void exec_status_start(ExecStatus *s, pid_t pid); | |||
void exec_status_exit(ExecStatus *s, ExecContext *context, pid_t pid, int c ode, int status); | void exec_status_exit(ExecStatus *s, ExecContext *context, pid_t pid, int c ode, int status); | |||
void exec_status_dump(ExecStatus *s, FILE *f, const char *prefix); | void exec_status_dump(ExecStatus *s, FILE *f, const char *prefix); | |||
const char* exec_output_to_string(ExecOutput i); | const char* exec_output_to_string(ExecOutput i) _const_; | |||
ExecOutput exec_output_from_string(const char *s); | ExecOutput exec_output_from_string(const char *s) _pure_; | |||
const char* exec_input_to_string(ExecInput i); | const char* exec_input_to_string(ExecInput i) _const_; | |||
ExecInput exec_input_from_string(const char *s); | ExecInput exec_input_from_string(const char *s) _pure_; | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
exit-status.h | exit-status.h | |||
---|---|---|---|---|
skipping to change at line 85 | skipping to change at line 85 | |||
EXIT_STATUS_SYSTEMD, | EXIT_STATUS_SYSTEMD, | |||
EXIT_STATUS_LSB, | EXIT_STATUS_LSB, | |||
EXIT_STATUS_FULL = EXIT_STATUS_LSB | EXIT_STATUS_FULL = EXIT_STATUS_LSB | |||
} ExitStatusLevel; | } ExitStatusLevel; | |||
typedef struct ExitStatusSet { | typedef struct ExitStatusSet { | |||
Set *code; | Set *code; | |||
Set *signal; | Set *signal; | |||
} ExitStatusSet; | } ExitStatusSet; | |||
const char* exit_status_to_string(ExitStatus status, ExitStatusLevel level) ; | const char* exit_status_to_string(ExitStatus status, ExitStatusLevel level) _const_; | |||
bool is_clean_exit(int code, int status, ExitStatusSet *success_status); | bool is_clean_exit(int code, int status, ExitStatusSet *success_status); | |||
bool is_clean_exit_lsb(int code, int status, ExitStatusSet *success_status) ; | bool is_clean_exit_lsb(int code, int status, ExitStatusSet *success_status) ; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
fileio.h | fileio.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
systemd is distributed in the hope that it will be useful, but | systemd is distributed in the hope that it will be useful, but | |||
WITHOUT ANY WARRANTY; without even the implied warranty of | WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#include <stddef.h> | #include <stddef.h> | |||
#include <stdio.h> | ||||
#include "macro.h" | #include "macro.h" | |||
int write_string_to_file(FILE *f, const char *line); | ||||
int write_string_file(const char *fn, const char *line); | int write_string_file(const char *fn, const char *line); | |||
int write_string_file_atomic(const char *fn, const char *line); | int write_string_file_atomic(const char *fn, const char *line); | |||
int read_one_line_file(const char *fn, char **line); | int read_one_line_file(const char *fn, char **line); | |||
int read_full_file(const char *fn, char **contents, size_t *size); | int read_full_file(const char *fn, char **contents, size_t *size); | |||
int parse_env_file(const char *fname, const char *separator, ...) _sentinel _; | int parse_env_file(const char *fname, const char *separator, ...) _sentinel _; | |||
int load_env_file(const char *fname, const char *separator, char ***l); | int load_env_file(const char *fname, const char *separator, char ***l); | |||
int write_env_file(const char *fname, char **l); | int write_env_file(const char *fname, char **l); | |||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 4 lines changed or added | |||
fsprg.h | fsprg.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
* You should have received a copy of the GNU Lesser General Public | * You should have received a copy of the GNU Lesser General Public | |||
* License along with this library; if not, write to the Free Software | * License along with this library; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | |||
* 02110-1301 USA | * 02110-1301 USA | |||
* | * | |||
*/ | */ | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include "macro.h" | ||||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
#define FSPRG_RECOMMENDED_SECPAR 1536 | #define FSPRG_RECOMMENDED_SECPAR 1536 | |||
#define FSPRG_RECOMMENDED_SEEDLEN (96/8) | #define FSPRG_RECOMMENDED_SEEDLEN (96/8) | |||
size_t FSPRG_mskinbytes(unsigned secpar); | size_t FSPRG_mskinbytes(unsigned secpar) _const_; | |||
size_t FSPRG_mpkinbytes(unsigned secpar); | size_t FSPRG_mpkinbytes(unsigned secpar) _const_; | |||
size_t FSPRG_stateinbytes(unsigned secpar); | size_t FSPRG_stateinbytes(unsigned secpar) _const_; | |||
/* Setup msk and mpk. Providing seed != NULL makes this algorithm determini stic. */ | /* Setup msk and mpk. Providing seed != NULL makes this algorithm determini stic. */ | |||
void FSPRG_GenMK(void *msk, void *mpk, const void *seed, size_t seedlen, un signed secpar); | void FSPRG_GenMK(void *msk, void *mpk, const void *seed, size_t seedlen, un signed secpar); | |||
/* Initialize state deterministically in dependence on seed. */ | /* Initialize state deterministically in dependence on seed. */ | |||
/* Note: in case one wants to run only one GenState0 per GenMK it is safe t o use | /* Note: in case one wants to run only one GenState0 per GenMK it is safe t o use | |||
the same seed for both GenMK and GenState0. | the same seed for both GenMK and GenState0. | |||
*/ | */ | |||
void FSPRG_GenState0(void *state, const void *mpk, const void *seed, size_t seedlen); | void FSPRG_GenState0(void *state, const void *mpk, const void *seed, size_t seedlen); | |||
void FSPRG_Evolve(void *state); | void FSPRG_Evolve(void *state); | |||
uint64_t FSPRG_GetEpoch(const void *state); | uint64_t FSPRG_GetEpoch(const void *state) _pure_; | |||
/* Seek to any arbitrary state (by providing msk together with seed from Ge nState0). */ | /* Seek to any arbitrary state (by providing msk together with seed from Ge nState0). */ | |||
void FSPRG_Seek(void *state, uint64_t epoch, const void *msk, const void *s eed, size_t seedlen); | void FSPRG_Seek(void *state, uint64_t epoch, const void *msk, const void *s eed, size_t seedlen); | |||
void FSPRG_GetKey(const void *state, void *key, size_t keylen, uint32_t idx ); | void FSPRG_GetKey(const void *state, void *key, size_t keylen, uint32_t idx ); | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 6 lines changed or added | |||
hashmap.h | hashmap.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
WITHOUT ANY WARRANTY; without even the implied warranty of | WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include "macro.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. */ | |||
typedef struct Hashmap Hashmap; | typedef struct Hashmap Hashmap; | |||
typedef struct _IteratorStruct _IteratorStruct; | typedef struct _IteratorStruct _IteratorStruct; | |||
typedef _IteratorStruct* Iterator; | typedef _IteratorStruct* Iterator; | |||
#define ITERATOR_FIRST ((Iterator) 0) | #define ITERATOR_FIRST ((Iterator) 0) | |||
#define ITERATOR_LAST ((Iterator) -1) | #define ITERATOR_LAST ((Iterator) -1) | |||
typedef unsigned (*hash_func_t)(const void *p); | typedef unsigned (*hash_func_t)(const void *p); | |||
typedef int (*compare_func_t)(const void *a, const void *b); | typedef int (*compare_func_t)(const void *a, const void *b); | |||
unsigned string_hash_func(const void *p); | unsigned string_hash_func(const void *p) _pure_; | |||
int string_compare_func(const void *a, const void *b); | int string_compare_func(const void *a, const void *b) _pure_; | |||
unsigned trivial_hash_func(const void *p); | unsigned trivial_hash_func(const void *p) _const_; | |||
int trivial_compare_func(const void *a, const void *b); | int trivial_compare_func(const void *a, const void *b) _const_; | |||
unsigned uint64_hash_func(const void *p); | unsigned uint64_hash_func(const void *p) _pure_; | |||
int uint64_compare_func(const void *a, const void *b); | int uint64_compare_func(const void *a, const void *b) _pure_; | |||
Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func); | Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func); | |||
void hashmap_free(Hashmap *h); | void hashmap_free(Hashmap *h); | |||
void hashmap_free_free(Hashmap *h); | void hashmap_free_free(Hashmap *h); | |||
void hashmap_free_free_free(Hashmap *h); | void hashmap_free_free_free(Hashmap *h); | |||
Hashmap *hashmap_copy(Hashmap *h); | Hashmap *hashmap_copy(Hashmap *h); | |||
int hashmap_ensure_allocated(Hashmap **h, hash_func_t hash_func, compare_fu nc_t compare_func); | int hashmap_ensure_allocated(Hashmap **h, hash_func_t hash_func, compare_fu nc_t compare_func); | |||
int hashmap_put(Hashmap *h, const void *key, void *value); | int hashmap_put(Hashmap *h, const void *key, void *value); | |||
int hashmap_update(Hashmap *h, const void *key, void *value); | int hashmap_update(Hashmap *h, const void *key, void *value); | |||
int hashmap_replace(Hashmap *h, const void *key, void *value); | int hashmap_replace(Hashmap *h, const void *key, void *value); | |||
void* hashmap_get(Hashmap *h, const void *key); | void *hashmap_get(Hashmap *h, const void *key); | |||
void* hashmap_get2(Hashmap *h, const void *key, void **rkey); | void *hashmap_get2(Hashmap *h, const void *key, void **rkey); | |||
bool hashmap_contains(Hashmap *h, const void *key); | bool hashmap_contains(Hashmap *h, const void *key); | |||
void* hashmap_remove(Hashmap *h, const void *key); | void *hashmap_remove(Hashmap *h, const void *key); | |||
void* hashmap_remove_value(Hashmap *h, const void *key, void *value); | void *hashmap_remove_value(Hashmap *h, const void *key, void *value); | |||
int hashmap_remove_and_put(Hashmap *h, const void *old_key, const void *new _key, void *value); | int hashmap_remove_and_put(Hashmap *h, const void *old_key, const void *new _key, void *value); | |||
int hashmap_remove_and_replace(Hashmap *h, const void *old_key, const void *new_key, void *value); | int hashmap_remove_and_replace(Hashmap *h, const void *old_key, const void *new_key, void *value); | |||
int hashmap_merge(Hashmap *h, Hashmap *other); | int hashmap_merge(Hashmap *h, Hashmap *other); | |||
void hashmap_move(Hashmap *h, Hashmap *other); | void hashmap_move(Hashmap *h, Hashmap *other); | |||
int hashmap_move_one(Hashmap *h, Hashmap *other, const void *key); | int hashmap_move_one(Hashmap *h, Hashmap *other, const void *key); | |||
unsigned hashmap_size(Hashmap *h); | unsigned hashmap_size(Hashmap *h) _pure_; | |||
bool hashmap_isempty(Hashmap *h); | bool hashmap_isempty(Hashmap *h) _pure_; | |||
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_clear_free(Hashmap *h); | |||
void hashmap_clear_free_free(Hashmap *h); | void hashmap_clear_free_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) _pure_; | |||
void* hashmap_first_key(Hashmap *h); | void *hashmap_first_key(Hashmap *h) _pure_; | |||
void* hashmap_last(Hashmap *h); | void *hashmap_last(Hashmap *h) _pure_; | |||
void *hashmap_next(Hashmap *h, const void *key); | void *hashmap_next(Hashmap *h, const void *key); | |||
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))) | |||
End of changes. 8 change blocks. | ||||
15 lines changed or deleted | 17 lines changed or added | |||
install.h | install.h | |||
---|---|---|---|---|
skipping to change at line 93 | skipping to change at line 93 | |||
UnitFileState unit_file_get_state(UnitFileScope scope, const char *root_dir , const char *filename); | UnitFileState unit_file_get_state(UnitFileScope scope, const char *root_dir , const char *filename); | |||
int unit_file_get_list(UnitFileScope scope, const char *root_dir, Hashmap * h); | int unit_file_get_list(UnitFileScope scope, const char *root_dir, Hashmap * h); | |||
void unit_file_list_free(Hashmap *h); | void unit_file_list_free(Hashmap *h); | |||
void unit_file_changes_free(UnitFileChange *changes, unsigned n_changes); | void unit_file_changes_free(UnitFileChange *changes, unsigned n_changes); | |||
int unit_file_query_preset(UnitFileScope scope, const char *name); | int unit_file_query_preset(UnitFileScope scope, const char *name); | |||
const char *unit_file_state_to_string(UnitFileState s); | const char *unit_file_state_to_string(UnitFileState s) _const_; | |||
UnitFileState unit_file_state_from_string(const char *s); | UnitFileState unit_file_state_from_string(const char *s) _pure_; | |||
const char *unit_file_change_type_to_string(UnitFileChangeType s); | const char *unit_file_change_type_to_string(UnitFileChangeType s) _const_; | |||
UnitFileChangeType unit_file_change_type_from_string(const char *s); | UnitFileChangeType unit_file_change_type_from_string(const char *s) _pure_; | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
job.h | job.h | |||
---|---|---|---|---|
skipping to change at line 186 | skipping to change at line 186 | |||
void job_dump(Job *j, FILE*f, const char *prefix); | void job_dump(Job *j, FILE*f, const char *prefix); | |||
int job_serialize(Job *j, FILE *f, FDSet *fds); | int job_serialize(Job *j, FILE *f, FDSet *fds); | |||
int job_deserialize(Job *j, FILE *f, FDSet *fds); | int job_deserialize(Job *j, FILE *f, FDSet *fds); | |||
int job_coldplug(Job *j); | int job_coldplug(Job *j); | |||
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); | |||
int job_merge(Job *j, Job *other); | int job_merge(Job *j, Job *other); | |||
JobType job_type_lookup_merge(JobType a, JobType b); | JobType job_type_lookup_merge(JobType a, JobType b) _pure_; | |||
static inline bool job_type_is_mergeable(JobType a, JobType b) { | _pure_ static inline bool job_type_is_mergeable(JobType a, JobType b) { | |||
return job_type_lookup_merge(a, b) >= 0; | return job_type_lookup_merge(a, b) >= 0; | |||
} | } | |||
static inline bool job_type_is_conflicting(JobType a, JobType b) { | _pure_ static inline bool job_type_is_conflicting(JobType a, JobType b) { | |||
return !job_type_is_mergeable(a, b); | return !job_type_is_mergeable(a, b); | |||
} | } | |||
static inline bool job_type_is_superset(JobType a, JobType b) { | _pure_ static inline bool job_type_is_superset(JobType a, JobType b) { | |||
/* Checks whether operation a is a "superset" of b in its actions * / | /* Checks whether operation a is a "superset" of b in its actions * / | |||
return a == job_type_lookup_merge(a, b); | 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) _pure_; | |||
/* Collapses a state-dependent job type into a simpler type by observing | /* Collapses a state-dependent job type into a simpler type by observing | |||
* the state of the unit which it is going to be applied to. */ | * the state of the unit which it is going to be applied to. */ | |||
void job_type_collapse(JobType *t, Unit *u); | void job_type_collapse(JobType *t, Unit *u); | |||
int job_type_merge_and_collapse(JobType *a, JobType b, Unit *u); | int job_type_merge_and_collapse(JobType *a, JobType b, Unit *u); | |||
bool job_is_runnable(Job *j); | bool job_is_runnable(Job *j); | |||
void job_add_to_run_queue(Job *j); | void job_add_to_run_queue(Job *j); | |||
skipping to change at line 224 | skipping to change at line 224 | |||
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, bool recursive); | int job_finish_and_invalidate(Job *j, JobResult result, bool recursive); | |||
char *job_dbus_path(Job *j); | char *job_dbus_path(Job *j); | |||
void job_shutdown_magic(Job *j); | void job_shutdown_magic(Job *j); | |||
const char* job_type_to_string(JobType t); | const char* job_type_to_string(JobType t) _const_; | |||
JobType job_type_from_string(const char *s); | JobType job_type_from_string(const char *s) _pure_; | |||
const char* job_state_to_string(JobState t); | const char* job_state_to_string(JobState t) _const_; | |||
JobState job_state_from_string(const char *s); | JobState job_state_from_string(const char *s) _pure_; | |||
const char* job_mode_to_string(JobMode t); | const char* job_mode_to_string(JobMode t) _const_; | |||
JobMode job_mode_from_string(const char *s); | JobMode job_mode_from_string(const char *s) _pure_; | |||
const char* job_result_to_string(JobResult t); | const char* job_result_to_string(JobResult t) _const_; | |||
JobResult job_result_from_string(const char *s); | JobResult job_result_from_string(const char *s) _pure_; | |||
End of changes. 9 change blocks. | ||||
11 lines changed or deleted | 11 lines changed or added | |||
journal-file.h | journal-file.h | |||
---|---|---|---|---|
skipping to change at line 153 | skipping to change at line 153 | |||
(le64toh((h)->header_size) >= offsetof(Header, field) + sizeof((h)- >field)) | (le64toh((h)->header_size) >= offsetof(Header, field) + sizeof((h)- >field)) | |||
#define JOURNAL_HEADER_SEALED(h) \ | #define JOURNAL_HEADER_SEALED(h) \ | |||
(!!(le32toh((h)->compatible_flags) & HEADER_COMPATIBLE_SEALED)) | (!!(le32toh((h)->compatible_flags) & HEADER_COMPATIBLE_SEALED)) | |||
#define JOURNAL_HEADER_COMPRESSED(h) \ | #define JOURNAL_HEADER_COMPRESSED(h) \ | |||
(!!(le32toh((h)->incompatible_flags) & HEADER_INCOMPATIBLE_COMPRESS ED)) | (!!(le32toh((h)->incompatible_flags) & HEADER_INCOMPATIBLE_COMPRESS ED)) | |||
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) _pure_; | |||
uint64_t journal_file_entry_array_n_items(Object *o); | uint64_t journal_file_entry_array_n_items(Object *o) _pure_; | |||
uint64_t journal_file_hash_table_n_items(Object *o); | uint64_t journal_file_hash_table_n_items(Object *o) _pure_; | |||
int journal_file_append_object(JournalFile *f, int type, uint64_t size, Obj ect **ret, uint64_t *offset); | int journal_file_append_object(JournalFile *f, int type, uint64_t size, Obj ect **ret, uint64_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_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_find_field_object(JournalFile *f, const void *field, uint6 4_t size, Object **ret, uint64_t *offset); | int journal_file_find_field_object(JournalFile *f, const void *field, uint6 4_t size, Object **ret, uint64_t *offset); | |||
int journal_file_find_field_object_with_hash(JournalFile *f, const void *fi eld, uint64_t size, uint64_t hash, Object **ret, uint64_t *offset); | int journal_file_find_field_object_with_hash(JournalFile *f, const void *fi eld, uint64_t size, uint64_t hash, Object **ret, uint64_t *offset); | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
journald-server.h | journald-server.h | |||
---|---|---|---|---|
skipping to change at line 133 | skipping to change at line 133 | |||
int sync_timer_fd; | int sync_timer_fd; | |||
bool sync_scheduled; | bool sync_scheduled; | |||
} Server; | } Server; | |||
#define N_IOVEC_META_FIELDS 17 | #define N_IOVEC_META_FIELDS 17 | |||
#define N_IOVEC_KERNEL_FIELDS 64 | #define N_IOVEC_KERNEL_FIELDS 64 | |||
#define N_IOVEC_UDEV_FIELDS 32 | #define N_IOVEC_UDEV_FIELDS 32 | |||
void server_dispatch_message(Server *s, struct iovec *iovec, unsigned n, un signed m, struct ucred *ucred, struct timeval *tv, const char *label, size_ t label_len, const char *unit_id, int priority); | void server_dispatch_message(Server *s, struct iovec *iovec, unsigned n, un signed m, struct ucred *ucred, struct timeval *tv, const char *label, size_ t label_len, const char *unit_id, int priority); | |||
void server_driver_message(Server *s, sd_id128_t message_id, const char *fo rmat, ...); | void server_driver_message(Server *s, sd_id128_t message_id, const char *fo rmat, ...) _printf_attr_(3,4); | |||
/* gperf lookup function */ | /* gperf lookup function */ | |||
const struct ConfigPerfItem* journald_gperf_lookup(const char *key, unsigne d length); | const struct ConfigPerfItem* journald_gperf_lookup(const char *key, unsigne d length); | |||
int config_parse_storage(const char *unit, const char *filename, unsigned l ine, const char *section, const char *lvalue, int ltype, const char *rvalue , void *data, void *userdata); | int config_parse_storage(const char *unit, const char *filename, unsigned l ine, const char *section, const char *lvalue, int ltype, const char *rvalue , void *data, void *userdata); | |||
const char *storage_to_string(Storage s); | const char *storage_to_string(Storage s) _const_; | |||
Storage storage_from_string(const char *s); | Storage storage_from_string(const char *s) _pure_; | |||
int config_parse_split_mode(const char *unit, const char *filename, unsigne d line, const char *section, const char *lvalue, int ltype, const char *rva lue, void *data, void *userdata); | int config_parse_split_mode(const char *unit, const char *filename, unsigne d line, const char *section, const char *lvalue, int ltype, const char *rva lue, void *data, void *userdata); | |||
const char *split_mode_to_string(SplitMode s); | const char *split_mode_to_string(SplitMode s) _const_; | |||
SplitMode split_mode_from_string(const char *s); | SplitMode split_mode_from_string(const char *s) _pure_; | |||
void server_fix_perms(Server *s, JournalFile *f, uid_t uid); | void server_fix_perms(Server *s, JournalFile *f, uid_t uid); | |||
bool shall_try_append_again(JournalFile *f, int r); | bool shall_try_append_again(JournalFile *f, int r); | |||
int server_init(Server *s); | int server_init(Server *s); | |||
void server_done(Server *s); | void server_done(Server *s); | |||
void server_sync(Server *s); | void server_sync(Server *s); | |||
void server_vacuum(Server *s); | void server_vacuum(Server *s); | |||
void server_rotate(Server *s); | void server_rotate(Server *s); | |||
int server_schedule_sync(Server *s); | int server_schedule_sync(Server *s); | |||
int server_flush_to_var(Server *s); | int server_flush_to_var(Server *s); | |||
End of changes. 3 change blocks. | ||||
5 lines changed or deleted | 5 lines changed or added | |||
journald-syslog.h | journald-syslog.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
WITHOUT ANY WARRANTY; without even the implied warranty of | WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#include "journald-server.h" | #include "journald-server.h" | |||
int syslog_fixup_facility(int priority); | int syslog_fixup_facility(int priority) _const_; | |||
void syslog_parse_priority(char **p, int *priority); | void syslog_parse_priority(char **p, int *priority); | |||
size_t syslog_parse_identifier(const char **buf, char **identifier, char ** pid); | size_t syslog_parse_identifier(const char **buf, char **identifier, char ** pid); | |||
void server_forward_syslog(Server *s, int priority, const char *identifier, const char *message, struct ucred *ucred, struct timeval *tv); | void server_forward_syslog(Server *s, int priority, const char *identifier, const char *message, struct ucred *ucred, struct timeval *tv); | |||
void server_process_syslog_message(Server *s, const char *buf, struct ucred *ucred, struct timeval *tv, const char *label, size_t label_len); | void server_process_syslog_message(Server *s, const char *buf, struct ucred *ucred, struct timeval *tv, const char *label, size_t label_len); | |||
int server_open_syslog_socket(Server *s); | int server_open_syslog_socket(Server *s); | |||
void server_maybe_warn_forward_syslog_missed(Server *s); | void server_maybe_warn_forward_syslog_missed(Server *s); | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
kdbus.h | kdbus.h | |||
---|---|---|---|---|
skipping to change at line 30 | skipping to change at line 30 | |||
#include <linux/types.h> | #include <linux/types.h> | |||
#endif | #endif | |||
#define KDBUS_IOC_MAGIC 0x95 | #define KDBUS_IOC_MAGIC 0x95 | |||
/* Message sent from kernel to userspace, when the owner or starter of | /* Message sent from kernel to userspace, when the owner or starter of | |||
* a well-known name changes */ | * a well-known name changes */ | |||
struct kdbus_manager_msg_name_change { | struct kdbus_manager_msg_name_change { | |||
__u64 old_id; | __u64 old_id; | |||
__u64 new_id; | __u64 new_id; | |||
__u64 flags; /* 0 or (possibly?) KDBUS_CMD_NAME_IN_QUEUE */ | __u64 flags; /* 0 or (possibly?) KDBUS_NAME_IN_QU EUE */ | |||
char name[0]; | char name[0]; | |||
}; | }; | |||
struct kdbus_manager_msg_id_change { | struct kdbus_manager_msg_id_change { | |||
__u64 id; | __u64 id; | |||
__u64 flags; /* The kernel flags field from KDBUS_CMD_HELLO */ | __u64 flags; /* The kernel flags field from KDBUS _HELLO */ | |||
}; | }; | |||
struct kdbus_creds { | struct kdbus_creds { | |||
__u64 uid; | __u64 uid; | |||
__u64 gid; | __u64 gid; | |||
__u64 pid; | __u64 pid; | |||
__u64 tid; | __u64 tid; | |||
/* The starttime of the process PID. This is useful to detect | /* The starttime of the process PID. This is useful to detect | |||
PID overruns from the client side. i.e. if you use the PID to | PID overruns from the client side. i.e. if you use the PID to | |||
skipping to change at line 70 | skipping to change at line 70 | |||
__u64 realtime_ns; | __u64 realtime_ns; | |||
}; | }; | |||
#define KDBUS_SRC_ID_KERNEL (0) | #define KDBUS_SRC_ID_KERNEL (0) | |||
#define KDBUS_DST_ID_WELL_KNOWN_NAME (0) | #define KDBUS_DST_ID_WELL_KNOWN_NAME (0) | |||
#define KDBUS_MATCH_SRC_ID_ANY (~0ULL) | #define KDBUS_MATCH_SRC_ID_ANY (~0ULL) | |||
#define KDBUS_DST_ID_BROADCAST (~0ULL) | #define KDBUS_DST_ID_BROADCAST (~0ULL) | |||
/* Message Item Types */ | /* Message Item Types */ | |||
enum { | enum { | |||
KDBUS_MSG_NULL, | ||||
/* Filled in by userspace */ | /* Filled in by userspace */ | |||
KDBUS_MSG_NULL, /* empty record */ | KDBUS_MSG_PAYLOAD, /* .data, inline memory */ | |||
KDBUS_MSG_PAYLOAD, /* .data */ | KDBUS_MSG_PAYLOAD_VEC, /* .data_vec, reference to memory ar | |||
KDBUS_MSG_PAYLOAD_VEC, /* .data_vec */ | ea */ | |||
KDBUS_MSG_UNIX_FDS, /* .data_fds of file descriptors */ | KDBUS_MSG_UNIX_FDS, /* .data_fds of file descriptors */ | |||
KDBUS_MSG_BLOOM, /* for broadcasts, carries bloom fil ter blob in .data */ | KDBUS_MSG_BLOOM, /* for broadcasts, carries bloom fil ter blob in .data */ | |||
KDBUS_MSG_DST_NAME, /* destination's well-known name, in .str */ | KDBUS_MSG_DST_NAME, /* destination's well-known name, in .str */ | |||
/* Filled in by kernelspace */ | /* Filled in by kernelspace */ | |||
KDBUS_MSG_SRC_NAMES = 0x200,/* NUL separated string list with we ll-known names of source */ | KDBUS_MSG_SRC_NAMES = 0x200,/* NUL separated string list with we ll-known names of source */ | |||
KDBUS_MSG_TIMESTAMP, /* .timestamp */ | KDBUS_MSG_TIMESTAMP, /* .timestamp */ | |||
KDBUS_MSG_SRC_CREDS, /* .creds */ | KDBUS_MSG_SRC_CREDS, /* .creds */ | |||
KDBUS_MSG_SRC_PID_COMM, /* optional, in .str */ | KDBUS_MSG_SRC_PID_COMM, /* optional, in .str */ | |||
KDBUS_MSG_SRC_TID_COMM, /* optional, in .str */ | KDBUS_MSG_SRC_TID_COMM, /* optional, in .str */ | |||
skipping to change at line 101 | skipping to change at line 102 | |||
/* Special messages from kernel, consisting of one and only one of t hese data blocks */ | /* Special messages from kernel, consisting of one and only one of t hese data blocks */ | |||
KDBUS_MSG_NAME_ADD = 0x400,/* .name_change */ | KDBUS_MSG_NAME_ADD = 0x400,/* .name_change */ | |||
KDBUS_MSG_NAME_REMOVE, /* .name_change */ | KDBUS_MSG_NAME_REMOVE, /* .name_change */ | |||
KDBUS_MSG_NAME_CHANGE, /* .name_change */ | KDBUS_MSG_NAME_CHANGE, /* .name_change */ | |||
KDBUS_MSG_ID_ADD, /* .id_change */ | KDBUS_MSG_ID_ADD, /* .id_change */ | |||
KDBUS_MSG_ID_REMOVE, /* .id_change */ | KDBUS_MSG_ID_REMOVE, /* .id_change */ | |||
KDBUS_MSG_REPLY_TIMEOUT, /* empty, but .reply_cookie in .kdbu s_msg is filled in */ | KDBUS_MSG_REPLY_TIMEOUT, /* empty, but .reply_cookie in .kdbu s_msg is filled in */ | |||
KDBUS_MSG_REPLY_DEAD, /* dito */ | KDBUS_MSG_REPLY_DEAD, /* dito */ | |||
}; | }; | |||
enum { | ||||
KDBUS_VEC_ALIGNED = 1 << 0, | ||||
}; | ||||
struct kdbus_vec { | struct kdbus_vec { | |||
__u64 address; | __u64 address; | |||
__u64 size; | __u64 size; | |||
__u64 flags; | ||||
}; | }; | |||
/** | /** | |||
* struct kdbus_msg_item - chain of data blocks | * struct kdbus_item - chain of data blocks | |||
* | * | |||
* size: overall data record size | * size: overall data record size | |||
* type: kdbus_msg_item type of data | * type: kdbus_item type of data | |||
*/ | */ | |||
struct kdbus_msg_item { | struct kdbus_item { | |||
__u64 size; | __u64 size; | |||
__u64 type; | __u64 type; | |||
union { | union { | |||
/* inline data */ | /* inline data */ | |||
__u8 data[0]; | __u8 data[0]; | |||
__u32 data32[0]; | __u32 data32[0]; | |||
__u64 data64[0]; | __u64 data64[0]; | |||
char str[0]; | char str[0]; | |||
/* connection */ | ||||
__u64 id; | ||||
/* data vector */ | /* data vector */ | |||
struct kdbus_vec vec; | struct kdbus_vec vec; | |||
/* specific fields */ | /* process credentials and properties*/ | |||
int fds[0]; /* int array of file | ||||
descriptors */ | ||||
struct kdbus_creds creds; | struct kdbus_creds creds; | |||
struct kdbus_audit audit; | struct kdbus_audit audit; | |||
struct kdbus_timestamp timestamp; | struct kdbus_timestamp timestamp; | |||
/* specific fields */ | ||||
int fds[0]; | ||||
struct kdbus_manager_msg_name_change name_change; | struct kdbus_manager_msg_name_change name_change; | |||
struct kdbus_manager_msg_id_change id_change; | struct kdbus_manager_msg_id_change id_change; | |||
}; | }; | |||
}; | }; | |||
enum { | enum { | |||
KDBUS_MSG_FLAGS_EXPECT_REPLY = 1, | KDBUS_MSG_FLAGS_EXPECT_REPLY = 1 << 0, | |||
KDBUS_MSG_FLAGS_NO_AUTO_START = 2, /* possibly? */ | KDBUS_MSG_FLAGS_NO_AUTO_START = 1 << 1, | |||
}; | }; | |||
enum { | enum { | |||
KDBUS_PAYLOAD_NONE = 0, | KDBUS_PAYLOAD_NULL, | |||
KDBUS_PAYLOAD_DBUS1 = 0x4442757356657231ULL, /* 'DBusVer1' */ | KDBUS_PAYLOAD_DBUS1 = 0x4442757356657231ULL, /* 'DBusVer1' */ | |||
KDBUS_PAYLOAD_GVARIANT = 0x4756617269616e74ULL, /* 'GVariant' */ | KDBUS_PAYLOAD_GVARIANT = 0x4756617269616e74ULL, /* 'GVariant' */ | |||
}; | }; | |||
/** | /** | |||
* struct kdbus_msg | * struct kdbus_msg | |||
* | * | |||
* set by userspace: | * set by userspace: | |||
* dst_id: destination id | * dst_id: destination id | |||
* flags: KDBUS_MSG_FLAGS_* | * flags: KDBUS_MSG_FLAGS_* | |||
* items: data records | * items: data records | |||
* | * | |||
* set by kernel: | * set by kernel: | |||
* src_id: who sent the message | * src_id: who sent the message | |||
*/ | */ | |||
struct kdbus_msg { | struct kdbus_msg { | |||
__u64 size; | __u64 size; | |||
__u64 flags; | __u64 flags; | |||
__u64 dst_id; /* connection, 0 == name in data, ~0 broadca | __u64 dst_id; /* connection, 0 == name in data, ~0 | |||
st */ | broadcast */ | |||
__u64 src_id; /* connection, 0 == kernel */ | __u64 src_id; /* connection, 0 == kernel */ | |||
__u64 payload_type; /* 'DBusVer1', 'GVariant', ... */ | __u64 payload_type; /* 'DBusVer1', 'GVariant', ... */ | |||
__u64 cookie; /* userspace-supplied cookie */ | __u64 cookie; /* userspace-supplied cookie */ | |||
union { | union { | |||
__u64 cookie_reply; /* cookie we reply to */ | __u64 cookie_reply; /* cookie we reply to */ | |||
__u64 timeout_ns; /* timespan to wait for reply */ | __u64 timeout_ns; /* timespan to wait for reply */ | |||
}; | }; | |||
struct kdbus_msg_item items[0]; | struct kdbus_item items[0]; | |||
}; | }; | |||
enum { | enum { | |||
KDBUS_POLICY_NULL, | ||||
KDBUS_POLICY_NAME, | KDBUS_POLICY_NAME, | |||
KDBUS_POLICY_ACCESS, | KDBUS_POLICY_ACCESS, | |||
}; | }; | |||
enum { | enum { | |||
KDBUS_POLICY_USER, | KDBUS_POLICY_ACCESS_NULL, | |||
KDBUS_POLICY_GROUP, | KDBUS_POLICY_ACCESS_USER, | |||
KDBUS_POLICY_WORLD, | KDBUS_POLICY_ACCESS_GROUP, | |||
KDBUS_POLICY_ACCESS_WORLD, | ||||
}; | }; | |||
enum { | enum { | |||
KDBUS_POLICY_RECV = 4, | KDBUS_POLICY_RECV = 1 << 2, | |||
KDBUS_POLICY_SEND = 2, | KDBUS_POLICY_SEND = 1 << 1, | |||
KDBUS_POLICY_OWN = 1, | KDBUS_POLICY_OWN = 1 << 0, | |||
}; | }; | |||
struct kdbus_policy { | struct kdbus_policy { | |||
__u64 size; | __u64 size; | |||
__u64 type; /* NAME or ACCESS */ | __u64 type; /* NAME or ACCESS */ | |||
union { | union { | |||
char name[0]; | char name[0]; | |||
struct { | struct { | |||
__u32 type; /* USER, GROUP, WORLD */ | __u32 type; /* USER, GROUP, WORLD */ | |||
__u32 bits; /* RECV, SEND, OWN */ | __u32 bits; /* RECV, SEND, OWN */ | |||
__u64 id; /* uid, gid, 0 */ | __u64 id; /* uid, gid, 0 */ | |||
} access; | } access; | |||
}; | }; | |||
}; | }; | |||
struct kdbus_cmd_policy { | struct kdbus_cmd_policy { | |||
__u64 size; | __u64 size; | |||
__u8 buffer[0]; /* a series of KDBUS_POLICY_NAME plus one or | __u8 buffer[0]; /* a series of KDBUS_POLICY_NAME plus one or | |||
* more KDBUS_POLICY_ACCESS each. */ | * more KDBUS_POLICY_ACCESS each. */ | |||
}; | }; | |||
/* Flags for struct kdbus_cmd_hello */ | ||||
enum { | enum { | |||
KDBUS_CMD_HELLO_STARTER = 1 << 0, | KDBUS_HELLO_STARTER = 1 << 0, | |||
KDBUS_CMD_HELLO_ACCEPT_FD = 1 << 1, | KDBUS_HELLO_ACCEPT_FD = 1 << 1, | |||
KDBUS_CMD_HELLO_ACCEPT_MMAP = 1 << 2, | ||||
/* The following have an effect on directed messages only -- | /* The following have an effect on directed messages only -- | |||
* not for broadcasts */ | * not for broadcasts */ | |||
KDBUS_CMD_HELLO_ATTACH_COMM = 1 << 10, | KDBUS_HELLO_ATTACH_COMM = 1 << 10, | |||
KDBUS_CMD_HELLO_ATTACH_EXE = 1 << 11, | KDBUS_HELLO_ATTACH_EXE = 1 << 11, | |||
KDBUS_CMD_HELLO_ATTACH_CMDLINE = 1 << 12, | KDBUS_HELLO_ATTACH_CMDLINE = 1 << 12, | |||
KDBUS_CMD_HELLO_ATTACH_CGROUP = 1 << 13, | KDBUS_HELLO_ATTACH_CGROUP = 1 << 13, | |||
KDBUS_CMD_HELLO_ATTACH_CAPS = 1 << 14, | KDBUS_HELLO_ATTACH_CAPS = 1 << 14, | |||
KDBUS_CMD_HELLO_ATTACH_SECLABEL = 1 << 15, | KDBUS_HELLO_ATTACH_SECLABEL = 1 << 15, | |||
KDBUS_CMD_HELLO_ATTACH_AUDIT = 1 << 16, | KDBUS_HELLO_ATTACH_AUDIT = 1 << 16, | |||
}; | ||||
/* Flags for kdbus_cmd_bus_make, kdbus_cmd_ep_make and | ||||
* kdbus_cmd_ns_make */ | ||||
enum { | ||||
KDBUS_ACCESS_GROUP = 1, | ||||
KDBUS_ACCESS_WORLD = 2, | ||||
KDBUS_POLICY_OPEN = 4, | ||||
}; | }; | |||
/* Items to append to kdbus_cmd_bus_make, kdbus_cmd_ep_make and | /* Items to append to struct kdbus_cmd_hello */ | |||
* kdbus_cmd_ns_make */ | ||||
enum { | enum { | |||
KDBUS_CMD_MAKE_NONE, | KDBUS_HELLO_NULL, | |||
KDBUS_CMD_MAKE_NAME, | ||||
KDBUS_CMD_MAKE_CGROUP, /* the cgroup hierarchy ID for which to atta | ||||
ch | ||||
* cgroup membership paths * to messages. */ | ||||
KDBUS_CMD_MAKE_CRED, /* allow translator services which connect | ||||
* to the bus on behalf of somebody else, | ||||
* allow specifiying the credentials of the | ||||
* client to connect on behalf on. Needs | ||||
* privileges */ | ||||
}; | ||||
struct kdbus_cmd_make_item { | ||||
__u64 size; | ||||
__u64 type; | ||||
union { | ||||
__u8 data[0]; | ||||
__u64 data64[0]; | ||||
char str[0]; | ||||
}; | ||||
}; | }; | |||
struct kdbus_cmd_hello { | struct kdbus_cmd_hello { | |||
__u64 size; | __u64 size; | |||
/* userspace → kernel, kernel → userspace */ | /* userspace → kernel, kernel → userspace */ | |||
__u64 conn_flags; /* userspace specifies its | __u64 conn_flags; /* userspace specifies its | |||
* capabilities and more, kernel | * capabilities and more, kernel | |||
* returns its capabilites and | * returns its capabilites and | |||
* more. Kernel might refuse client's | * more. Kernel might refuse client's | |||
* capabilities by returning an error | * capabilities by returning an error | |||
* from KDBUS_CMD_HELLO */ | * from KDBUS_HELLO */ | |||
/* kernel → userspace */ | /* kernel → userspace */ | |||
__u64 bus_flags; /* this is .flags copied verbatim from | __u64 bus_flags; /* this is .flags copied verbatim from | |||
* from original KDBUS_CMD_BUS_MAKE | * from original KDBUS_CMD_BUS_MAKE | |||
* ioctl. It's intended to be useful | * ioctl. It's intended to be useful | |||
* to do negotiation of features of | * to do negotiation of features of | |||
* the payload that is transfreted. */ | * the payload that is transfreted. */ | |||
__u64 id; /* id assigned to this connection */ | __u64 id; /* id assigned to this connection */ | |||
__u64 bloom_size; /* The bloom filter size chosen by the | __u64 bloom_size; /* The bloom filter size chosen by the | |||
* bus owner */ | * bus owner */ | |||
struct kdbus_cmd_make_item items[0]; | struct kdbus_item items[0]; | |||
}; | ||||
/* Flags for kdbus_cmd_{bus,ep,ns}_make */ | ||||
enum { | ||||
KDBUS_MAKE_ACCESS_GROUP = 1 << 0, | ||||
KDBUS_MAKE_ACCESS_WORLD = 1 << 1, | ||||
KDBUS_MAKE_POLICY_OPEN = 1 << 2, | ||||
}; | ||||
/* Items to append to kdbus_cmd_{bus,ep,ns}_make */ | ||||
enum { | ||||
KDBUS_MAKE_NULL, | ||||
KDBUS_MAKE_NAME, | ||||
KDBUS_MAKE_CGROUP, /* the cgroup hierarchy ID for which to atta | ||||
ch | ||||
* cgroup membership paths * to messages. */ | ||||
KDBUS_MAKE_CRED, /* allow translator services which connect | ||||
* to the bus on behalf of somebody else, | ||||
* allow specifying the credentials of the | ||||
* client to connect on behalf on. Needs | ||||
* privileges */ | ||||
}; | }; | |||
struct kdbus_cmd_bus_make { | struct kdbus_cmd_bus_make { | |||
__u64 size; | __u64 size; | |||
__u64 flags; /* userspace → kernel, kernel → userspace | __u64 flags; /* userspace → kernel, kernel → userspace | |||
* When creating a bus feature | * When creating a bus feature | |||
* kernel negotiation. */ | * kernel negotiation. */ | |||
__u64 bus_flags; /* userspace → kernel | __u64 bus_flags; /* userspace → kernel | |||
* When a bus is created this value is | * When a bus is created this value is | |||
* copied verbatim into the bus | * copied verbatim into the bus | |||
* structure and returned from | * structure and returned from | |||
* KDBUS_CMD_HELLO, later */ | * KDBUS_CMD_HELLO, later */ | |||
__u64 bloom_size; /* size of the bloom filter for this bus */ | __u64 bloom_size; /* size of the bloom filter for this bus */ | |||
struct kdbus_cmd_make_item items[0]; | struct kdbus_item items[0]; | |||
}; | }; | |||
struct kdbus_cmd_ep_make { | struct kdbus_cmd_ep_make { | |||
__u64 size; | __u64 size; | |||
__u64 flags; /* userspace → kernel, kernel → userspace | __u64 flags; /* userspace → kernel, kernel → userspace | |||
* When creating an entry point | * When creating an entry point | |||
* feature kernel negotiation done the | * feature kernel negotiation done the | |||
* same way as for | * same way as for | |||
* KDBUS_CMD_BUS_MAKE. Unused for | * KDBUS_CMD_BUS_MAKE. Unused for | |||
* now. */ | * now. */ | |||
struct kdbus_cmd_make_item items[0]; | struct kdbus_item items[0]; | |||
}; | }; | |||
struct kdbus_cmd_ns_make { | struct kdbus_cmd_ns_make { | |||
__u64 size; | __u64 size; | |||
__u64 flags; /* userspace → kernel, kernel → userspace | __u64 flags; /* userspace → kernel, kernel → userspace | |||
* When creating an entry point | * When creating an entry point | |||
* feature kernel negotiation done the | * feature kernel negotiation done the | |||
* same way as for | * same way as for | |||
* KDBUS_CMD_BUS_MAKE. Unused for | * KDBUS_CMD_BUS_MAKE. Unused for | |||
* now. */ | * now. */ | |||
struct kdbus_cmd_make_item items[0]; | struct kdbus_item items[0]; | |||
}; | }; | |||
enum { | enum { | |||
/* userspace → kernel */ | /* userspace → kernel */ | |||
KDBUS_CMD_NAME_REPLACE_EXISTING = 1, | KDBUS_NAME_REPLACE_EXISTING = 1 << 0, | |||
KDBUS_CMD_NAME_QUEUE = 2, | KDBUS_NAME_QUEUE = 1 << 1, | |||
KDBUS_CMD_NAME_ALLOW_REPLACEMENT = 4, | KDBUS_NAME_ALLOW_REPLACEMENT = 1 << 2, | |||
/* kernel → userspace */ | /* kernel → userspace */ | |||
KDBUS_CMD_NAME_IN_QUEUE = 0x200, | KDBUS_NAME_IN_QUEUE = 1 << 16, | |||
}; | }; | |||
struct kdbus_cmd_name { | struct kdbus_cmd_name { | |||
__u64 size; | __u64 size; | |||
__u64 name_flags; | __u64 name_flags; | |||
__u64 id; /* We allow registration/deregestration of n ames of other peers */ | __u64 id; /* We allow registration/deregestration of n ames of other peers */ | |||
__u64 conn_flags; | __u64 conn_flags; | |||
char name[0]; | char name[0]; | |||
}; | }; | |||
struct kdbus_cmd_names { | struct kdbus_cmd_names { | |||
__u64 size; | __u64 size; | |||
struct kdbus_cmd_name names[0]; | struct kdbus_cmd_name names[0]; | |||
}; | }; | |||
enum { | enum { | |||
KDBUS_CMD_NAME_INFO_ITEM_NAME, /* userspace → kernel */ | KDBUS_NAME_INFO_ITEM_NULL, | |||
KDBUS_CMD_NAME_INFO_ITEM_SECLABEL, /* kernel → userspace */ | KDBUS_NAME_INFO_ITEM_NAME, /* userspace → kernel */ | |||
KDBUS_CMD_NAME_INFO_ITEM_AUDIT, /* kernel → userspace */ | KDBUS_NAME_INFO_ITEM_SECLABEL, /* kernel → userspace */ | |||
}; | KDBUS_NAME_INFO_ITEM_AUDIT, /* kernel → userspace */ | |||
struct kdbus_cmd_name_info_item { | ||||
__u64 size; | ||||
__u64 type; | ||||
__u8 data[0]; | ||||
}; | }; | |||
struct kdbus_cmd_name_info { | struct kdbus_cmd_name_info { | |||
__u64 size; /* overall size of info */ | __u64 size; /* overall size of info */ | |||
__u64 flags; | __u64 flags; | |||
__u64 id; /* either ID, or 0 and _ITEM_NAME fo llows */ | __u64 id; /* either ID, or 0 and _ITEM_NAME fo llows */ | |||
struct kdbus_creds creds; | struct kdbus_creds creds; | |||
struct kdbus_cmd_name_info_item items[0]; /* list of item records */ | struct kdbus_item items[0]; /* list of item records */ | |||
}; | }; | |||
enum { | enum { | |||
KDBUS_CMD_MATCH_BLOOM, /* Matches a mask blob against KDBUS | KDBUS_MATCH_NULL, | |||
_MSG_BLOOM */ | KDBUS_MATCH_BLOOM, /* Matches a mask blob against KDBUS | |||
KDBUS_CMD_MATCH_SRC_NAME, /* Matches a name string against KDB | _MSG_BLOOM */ | |||
US_MSG_SRC_NAMES */ | KDBUS_MATCH_SRC_NAME, /* Matches a name string against KDB | |||
KDBUS_CMD_MATCH_NAME_ADD, /* Matches a name string against KDB | US_MSG_SRC_NAMES */ | |||
US_MSG_NAME_ADD */ | KDBUS_MATCH_NAME_ADD, /* Matches a name string against KDB | |||
KDBUS_CMD_MATCH_NAME_REMOVE, /* Matches a name string against KDB | US_MSG_NAME_ADD */ | |||
US_MSG_NAME_REMOVE */ | KDBUS_MATCH_NAME_REMOVE, /* Matches a name string against KDB | |||
KDBUS_CMD_MATCH_NAME_CHANGE, /* Matches a name string against KDB | US_MSG_NAME_REMOVE */ | |||
US_MSG_NAME_CHANGE */ | KDBUS_MATCH_NAME_CHANGE, /* Matches a name string against KDB | |||
KDBUS_CMD_MATCH_ID_ADD, /* Matches an ID against KDBUS_MSG_I | US_MSG_NAME_CHANGE */ | |||
D_ADD */ | KDBUS_MATCH_ID_ADD, /* Matches an ID against KDBUS_MSG_I | |||
KDBUS_CMD_MATCH_ID_REMOVE, /* Matches an ID against KDBUS_MSG_I | D_ADD */ | |||
D_REMOVE */ | KDBUS_MATCH_ID_REMOVE, /* Matches an ID against KDBUS_MSG_I | |||
}; | D_REMOVE */ | |||
struct kdbus_cmd_match_item { | ||||
__u64 size; | ||||
__u64 type; | ||||
union { | ||||
__u64 id; | ||||
__u8 data[0]; | ||||
char str[0]; | ||||
}; | ||||
}; | }; | |||
struct kdbus_cmd_match { | struct kdbus_cmd_match { | |||
__u64 size; | __u64 size; | |||
__u64 id; /* We allow registration/deregestration of matches f or other peers */ | __u64 id; /* We allow registration/deregestration of matches f or other peers */ | |||
__u64 cookie; /* userspace supplied cookie; when removing; kernel deletes everything with same cookie */ | __u64 cookie; /* userspace supplied cookie; when removing; kernel deletes everything with same cookie */ | |||
__u64 src_id; /* ~0: any. other: exact unique match */ | __u64 src_id; /* ~0: any. other: exact unique match */ | |||
struct kdbus_cmd_match_item items[0]; | struct kdbus_item items[0]; | |||
}; | }; | |||
struct kdbus_cmd_monitor { | struct kdbus_cmd_monitor { | |||
__u64 id; /* We allow setting the monitor flag of othe r peers */ | __u64 id; /* We allow setting the monitor flag of othe r peers */ | |||
int enabled; /* A boolean to enable/disable monitoring */ | unsigned int enabled; /* A boolean to enable/disable monitoring */ | |||
}; | }; | |||
/* FD states: | /* FD states: | |||
* control nodes: unset | * control nodes: unset | |||
* bus owner (via KDBUS_CMD_BUS_MAKE) | * bus owner (via KDBUS_CMD_BUS_MAKE) | |||
* ns owner (via KDBUS_CMD_NS_MAKE) | * ns owner (via KDBUS_CMD_NS_MAKE) | |||
* | * | |||
* ep nodes: unset | * ep nodes: unset | |||
* connected (via KDBUS_CMD_HELLO) | * connected (via KDBUS_CMD_HELLO) | |||
* starter (via KDBUS_CMD_HELLO with KDBUS_CMD_HELLO_STARTER) | * starter (via KDBUS_CMD_HELLO with KDBUS_CMD_HELLO_STARTER) | |||
* ep owner (via KDBUS_CMD_EP_MAKE) | * ep owner (via KDBUS_CMD_EP_MAKE) | |||
*/ | */ | |||
enum kdbus_cmd { | enum kdbus_cmd { | |||
/* kdbus control node commands: require unset state */ | /* kdbus control node commands: require unset state */ | |||
KDBUS_CMD_BUS_MAKE = _IOWR(KDBUS_IOC_MAGIC, 0x00, struct kdbus_cmd_bus_make), | KDBUS_CMD_BUS_MAKE = _IOWR(KDBUS_IOC_MAGIC, 0x00, struct kdbus_cmd_bus_make), | |||
KDBUS_CMD_NS_MAKE = _IOWR(KDBUS_IOC_MAGIC, 0x10, struct kdbus_cmd_ns_make), | KDBUS_CMD_NS_MAKE = _IOWR(KDBUS_IOC_MAGIC, 0x10, struct kdbus_cmd_ns_make), | |||
/* kdbus control node commands: require bus owner state */ | ||||
KDBUS_CMD_BUS_POLICY_SET = _IOWR(KDBUS_IOC_MAGIC, 0x20, struct | ||||
kdbus_cmd_policy), | ||||
/* kdbus ep node commands: require unset state */ | /* kdbus ep node commands: require unset state */ | |||
KDBUS_CMD_EP_MAKE = _IOWR(KDBUS_IOC_MAGIC, 0x30, struct | KDBUS_CMD_EP_MAKE = _IOWR(KDBUS_IOC_MAGIC, 0x20, struct | |||
kdbus_cmd_ep_make), | kdbus_cmd_ep_make), | |||
KDBUS_CMD_HELLO = _IOWR(KDBUS_IOC_MAGIC, 0x31, struct | KDBUS_CMD_HELLO = _IOWR(KDBUS_IOC_MAGIC, 0x30, struct | |||
kdbus_cmd_hello), | kdbus_cmd_hello), | |||
/* kdbus ep node commands: require connected state */ | /* kdbus ep node commands: require connected state */ | |||
KDBUS_CMD_MSG_SEND = _IOWR(KDBUS_IOC_MAGIC, 0x40, struct kdbus_msg), | KDBUS_CMD_MSG_SEND = _IOWR(KDBUS_IOC_MAGIC, 0x40, struct kdbus_msg), | |||
KDBUS_CMD_MSG_RECV = _IOWR(KDBUS_IOC_MAGIC, 0x41, struct kdbus_msg), | KDBUS_CMD_MSG_RECV = _IOWR(KDBUS_IOC_MAGIC, 0x41, struct kdbus_msg), | |||
KDBUS_CMD_NAME_ACQUIRE = _IOWR(KDBUS_IOC_MAGIC, 0x50, struct kdbus_cmd_name), | KDBUS_CMD_NAME_ACQUIRE = _IOWR(KDBUS_IOC_MAGIC, 0x50, struct kdbus_cmd_name), | |||
KDBUS_CMD_NAME_RELEASE = _IOWR(KDBUS_IOC_MAGIC, 0x51, struct kdbus_cmd_name), | KDBUS_CMD_NAME_RELEASE = _IOWR(KDBUS_IOC_MAGIC, 0x51, struct kdbus_cmd_name), | |||
KDBUS_CMD_NAME_LIST = _IOWR(KDBUS_IOC_MAGIC, 0x52, struct kdbus_cmd_names), | KDBUS_CMD_NAME_LIST = _IOWR(KDBUS_IOC_MAGIC, 0x52, struct kdbus_cmd_names), | |||
KDBUS_CMD_NAME_QUERY = _IOWR(KDBUS_IOC_MAGIC, 0x53, struct kdbus_cmd_name_info), | KDBUS_CMD_NAME_QUERY = _IOWR(KDBUS_IOC_MAGIC, 0x53, struct kdbus_cmd_name_info), | |||
End of changes. 39 change blocks. | ||||
123 lines changed or deleted | 109 lines changed or added | |||
kill.h | kill.h | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
typedef struct KillContext KillContext; | typedef struct KillContext KillContext; | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#include "macro.h" | ||||
typedef enum KillMode { | typedef enum KillMode { | |||
/* The kill mode is a property of a unit. */ | /* The kill mode is a property of a unit. */ | |||
KILL_CONTROL_GROUP = 0, | KILL_CONTROL_GROUP = 0, | |||
KILL_PROCESS, | KILL_PROCESS, | |||
KILL_NONE, | KILL_NONE, | |||
_KILL_MODE_MAX, | _KILL_MODE_MAX, | |||
_KILL_MODE_INVALID = -1 | _KILL_MODE_INVALID = -1 | |||
} KillMode; | } KillMode; | |||
struct KillContext { | struct KillContext { | |||
skipping to change at line 56 | skipping to change at line 58 | |||
KILL_MAIN, | KILL_MAIN, | |||
KILL_CONTROL, | KILL_CONTROL, | |||
KILL_ALL, | KILL_ALL, | |||
_KILL_WHO_MAX, | _KILL_WHO_MAX, | |||
_KILL_WHO_INVALID = -1 | _KILL_WHO_INVALID = -1 | |||
} KillWho; | } KillWho; | |||
void kill_context_init(KillContext *c); | void kill_context_init(KillContext *c); | |||
void kill_context_dump(KillContext *c, FILE *f, const char *prefix); | void kill_context_dump(KillContext *c, FILE *f, const char *prefix); | |||
const char *kill_mode_to_string(KillMode k); | const char *kill_mode_to_string(KillMode k) _const_; | |||
KillMode kill_mode_from_string(const char *s); | KillMode kill_mode_from_string(const char *s) _pure_; | |||
const char *kill_who_to_string(KillWho k); | const char *kill_who_to_string(KillWho k) _const_; | |||
KillWho kill_who_from_string(const char *s); | KillWho kill_who_from_string(const char *s) _pure_; | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 4 lines changed or added | |||
load-fragment.h | load-fragment.h | |||
---|---|---|---|---|
skipping to change at line 64 | skipping to change at line 64 | |||
int config_parse_exec_capabilities(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const ch ar *rvalue, void *data, void *userdata); | int config_parse_exec_capabilities(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const ch ar *rvalue, void *data, void *userdata); | |||
int config_parse_exec_secure_bits(const char *unit, const char *filename, u nsigned line, const char *section, const char *lvalue, int ltype, const cha r *rvalue, void *data, void *userdata); | int config_parse_exec_secure_bits(const char *unit, const char *filename, u nsigned line, const char *section, const char *lvalue, int ltype, const cha r *rvalue, void *data, void *userdata); | |||
int config_parse_bounding_set(const char *unit, const char *filename, unsig ned line, const char *section, const char *lvalue, int ltype, const char *r value, void *data, void *userdata); | int config_parse_bounding_set(const char *unit, const char *filename, unsig ned line, const char *section, const char *lvalue, int ltype, const char *r value, void *data, void *userdata); | |||
int config_parse_limit(const char *unit, const char *filename, unsigned lin e, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_limit(const char *unit, const char *filename, unsigned lin e, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_cgroup(const char *unit, const char *filename, unsign ed line, const char *section, const char *lvalue, int ltype, const char *rv alue, void *data, void *userdata); | int config_parse_unit_cgroup(const char *unit, const char *filename, unsign ed line, const char *section, const char *lvalue, int ltype, const char *rv alue, void *data, void *userdata); | |||
int config_parse_sysv_priority(const char *unit, const char *filename, unsi gned line, const char *section, const char *lvalue, int ltype, const char * rvalue, void *data, void *userdata); | int config_parse_sysv_priority(const char *unit, const char *filename, unsi gned line, const char *section, const char *lvalue, int ltype, const char * rvalue, void *data, void *userdata); | |||
int config_parse_fsck_passno(const char *unit, const char *filename, unsign ed line, const char *section, const char *lvalue, int ltype, const char *rv alue, void *data, void *userdata); | int config_parse_fsck_passno(const char *unit, const char *filename, unsign ed line, const char *section, const char *lvalue, int ltype, const char *rv alue, void *data, void *userdata); | |||
int config_parse_kill_signal(const char *unit, const char *filename, unsign ed line, const char *section, const char *lvalue, int ltype, const char *rv alue, void *data, void *userdata); | int config_parse_kill_signal(const char *unit, const char *filename, unsign ed line, const char *section, const char *lvalue, int ltype, const char *rv alue, void *data, void *userdata); | |||
int config_parse_exec_mount_flags(const char *unit, const char *filename, u nsigned line, const char *section, const char *lvalue, int ltype, const cha r *rvalue, void *data, void *userdata); | int config_parse_exec_mount_flags(const char *unit, const char *filename, u nsigned line, const char *section, const char *lvalue, int ltype, const cha r *rvalue, void *data, void *userdata); | |||
int config_parse_timer(const char *unit, const char *filename, unsigned lin e, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_timer(const char *unit, const char *filename, unsigned lin e, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_timer_unit(const char *unit, const char *filename, unsigne d line, const char *section, const char *lvalue, int ltype, const char *rva lue, void *data, void *userdata); | int config_parse_trigger_unit(const char *unit, const char *filename, unsig ned line, const char *section, const char *lvalue, int ltype, const char *r value, void *data, void *userdata); | |||
int config_parse_path_spec(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rval ue, void *data, void *userdata); | int config_parse_path_spec(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rval ue, void *data, void *userdata); | |||
int config_parse_path_unit(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rval ue, void *data, void *userdata); | ||||
int config_parse_socket_service(const char *unit, const char *filename, uns igned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_socket_service(const char *unit, const char *filename, uns igned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_service_sockets(const char *unit, const char *filename, un signed line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_service_sockets(const char *unit, const char *filename, un signed line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_env_file(const char *unit, const char *filename, unsi gned line, const char *section, const char *lvalue, int ltype, const char * rvalue, void *data, void *userdata); | int config_parse_unit_env_file(const char *unit, const char *filename, unsi gned line, const char *section, const char *lvalue, int ltype, const char * rvalue, void *data, void *userdata); | |||
int config_parse_ip_tos(const char *unit, const char *filename, unsigned li ne, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_ip_tos(const char *unit, const char *filename, unsigned li ne, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_condition_path(const char *unit, const char *filename , unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_unit_condition_path(const char *unit, const char *filename , unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_condition_string(const char *unit, const char *filena me, unsigned line, const char *section, const char *lvalue, int ltype, cons t char *rvalue, void *data, void *userdata); | int config_parse_unit_condition_string(const char *unit, const char *filena me, unsigned line, const char *section, const char *lvalue, int ltype, cons t char *rvalue, void *data, void *userdata); | |||
int config_parse_unit_condition_null(const char *unit, const char *filename , unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | int config_parse_unit_condition_null(const char *unit, const char *filename , unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); | |||
int config_parse_kill_mode(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rval ue, void *data, void *userdata); | int config_parse_kill_mode(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rval ue, void *data, void *userdata); | |||
int config_parse_notify_access(const char *unit, const char *filename, unsi gned line, const char *section, const char *lvalue, int ltype, const char * rvalue, void *data, void *userdata); | int config_parse_notify_access(const char *unit, const char *filename, unsi gned line, const char *section, const char *lvalue, int ltype, const char * rvalue, void *data, void *userdata); | |||
int config_parse_start_limit_action(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const c har *rvalue, void *data, void *userdata); | int config_parse_start_limit_action(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const c har *rvalue, void *data, void *userdata); | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added | |||
log.h | log.h | |||
---|---|---|---|---|
skipping to change at line 59 | skipping to change at line 59 | |||
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); | |||
LogTarget log_get_target(void); | LogTarget log_get_target(void) _pure_; | |||
int log_get_max_level(void); | int log_get_max_level(void) _pure_; | |||
int log_open(void); | int log_open(void); | |||
void log_close(void); | void log_close(void); | |||
void log_forget_fds(void); | void log_forget_fds(void); | |||
void log_close_syslog(void); | void log_close_syslog(void); | |||
void log_close_journal(void); | void log_close_journal(void); | |||
void log_close_kmsg(void); | void log_close_kmsg(void); | |||
void log_close_console(void); | void log_close_console(void); | |||
skipping to change at line 86 | skipping to change at line 86 | |||
int line, | int line, | |||
const char *func, | const char *func, | |||
const char *format, ...) _printf_attr_(5,6); | const char *format, ...) _printf_attr_(5,6); | |||
int log_metav( | int log_metav( | |||
int level, | int level, | |||
const char*file, | const char*file, | |||
int line, | int line, | |||
const char *func, | const char *func, | |||
const char *format, | const char *format, | |||
va_list ap); | va_list ap) _printf_attr_(5,0); | |||
int log_meta_object( | int log_meta_object( | |||
int level, | int level, | |||
const char*file, | const char*file, | |||
int line, | int line, | |||
const char *func, | const char *func, | |||
const char *object_name, | const char *object_name, | |||
const char *object, | const char *object, | |||
const char *format, ...) _printf_attr_(7,8); | const char *format, ...) _printf_attr_(7,8); | |||
int log_metav_object( | int log_metav_object( | |||
int level, | int level, | |||
const char*file, | const char*file, | |||
int line, | int line, | |||
const char *func, | const char *func, | |||
const char *object_name, | const char *object_name, | |||
const char *object, | const char *object, | |||
const char *format, | const char *format, | |||
va_list ap); | va_list ap) _printf_attr_(7,0); | |||
int log_struct_internal( | int log_struct_internal( | |||
int level, | int level, | |||
const char *file, | const char *file, | |||
int line, | int line, | |||
const char *func, | const char *func, | |||
const char *format, ...) _sentinel_; | const char *format, ...) _printf_attr_(5,0) _sentinel_; | |||
int log_oom_internal( | int log_oom_internal( | |||
const char *file, | const char *file, | |||
int line, | int line, | |||
const char *func); | const char *func); | |||
/* This modifies the buffer passed! */ | /* This modifies the buffer passed! */ | |||
int log_dump_internal( | int log_dump_internal( | |||
int level, | int level, | |||
const char*file, | const char*file, | |||
skipping to change at line 154 | skipping to change at line 154 | |||
#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__) | |||
#define log_struct(level, ...) log_struct_internal(level, __FILE__, __LINE_ _, __func__, __VA_ARGS__) | #define log_struct(level, ...) log_struct_internal(level, __FILE__, __LINE_ _, __func__, __VA_ARGS__) | |||
#define log_oom() log_oom_internal(__FILE__, __LINE__, __func__) | #define log_oom() log_oom_internal(__FILE__, __LINE__, __func__) | |||
/* This modifies the buffer passed! */ | /* This modifies the buffer passed! */ | |||
#define log_dump(level, buffer) log_dump_internal(level, __FILE__, __LINE__ , __func__, buffer) | #define log_dump(level, buffer) log_dump_internal(level, __FILE__, __LINE__ , __func__, buffer) | |||
bool log_on_console(void); | bool log_on_console(void) _pure_; | |||
const char *log_target_to_string(LogTarget target); | const char *log_target_to_string(LogTarget target) _const_; | |||
LogTarget log_target_from_string(const char *s); | LogTarget log_target_from_string(const char *s) _pure_; | |||
#define MESSAGE_ID(x) "MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VA L(x) | #define MESSAGE_ID(x) "MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VA L(x) | |||
End of changes. 6 change blocks. | ||||
8 lines changed or deleted | 8 lines changed or added | |||
logind-action.h | logind-action.h | |||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
#include "logind.h" | #include "logind.h" | |||
#include "logind-inhibit.h" | #include "logind-inhibit.h" | |||
int manager_handle_action( | int manager_handle_action( | |||
Manager *m, | Manager *m, | |||
InhibitWhat inhibit_key, | InhibitWhat inhibit_key, | |||
HandleAction handle, | HandleAction handle, | |||
bool ignore_inhibited, | bool ignore_inhibited, | |||
bool is_edge); | bool is_edge); | |||
const char* handle_action_to_string(HandleAction h); | const char* handle_action_to_string(HandleAction h) _const_; | |||
HandleAction handle_action_from_string(const char *s); | HandleAction handle_action_from_string(const char *s) _pure_; | |||
int config_parse_handle_action(const char *unit, const char *filename, unsi gned line, const char *section, const char *lvalue, int ltype, const char * rvalue, void *data, void *userdata); | int config_parse_handle_action(const char *unit, const char *filename, unsi gned line, const char *section, const char *lvalue, int ltype, const char * rvalue, void *data, void *userdata); | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
logind-session.h | logind-session.h | |||
---|---|---|---|---|
skipping to change at line 138 | skipping to change at line 138 | |||
SessionState session_get_state(Session *u); | SessionState session_get_state(Session *u); | |||
extern const DBusObjectPathVTable bus_session_vtable; | extern const DBusObjectPathVTable bus_session_vtable; | |||
int session_send_signal(Session *s, bool new_session); | int session_send_signal(Session *s, bool new_session); | |||
int session_send_changed(Session *s, const char *properties); | int session_send_changed(Session *s, const char *properties); | |||
int session_send_lock(Session *s, bool lock); | int session_send_lock(Session *s, bool lock); | |||
int session_send_lock_all(Manager *m, bool lock); | int session_send_lock_all(Manager *m, bool lock); | |||
const char* session_state_to_string(SessionState t); | const char* session_state_to_string(SessionState t) _const_; | |||
SessionState session_state_from_string(const char *s); | SessionState session_state_from_string(const char *s) _pure_; | |||
const char* session_type_to_string(SessionType t); | const char* session_type_to_string(SessionType t) _const_; | |||
SessionType session_type_from_string(const char *s); | SessionType session_type_from_string(const char *s) _pure_; | |||
const char* session_class_to_string(SessionClass t); | const char* session_class_to_string(SessionClass t) _const_; | |||
SessionClass session_class_from_string(const char *s); | SessionClass session_class_from_string(const char *s) _pure_; | |||
const char *kill_who_to_string(KillWho k); | const char *kill_who_to_string(KillWho k) _const_; | |||
KillWho kill_who_from_string(const char *s); | KillWho kill_who_from_string(const char *s) _pure_; | |||
End of changes. 4 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added | |||
logind-user.h | logind-user.h | |||
---|---|---|---|---|
skipping to change at line 83 | skipping to change at line 83 | |||
int user_load(User *u); | int user_load(User *u); | |||
int user_kill(User *u, int signo); | int user_kill(User *u, int signo); | |||
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) _const_; | |||
UserState user_state_from_string(const char *s); | UserState user_state_from_string(const char *s) _pure_; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
logs-show.h | logs-show.h | |||
---|---|---|---|---|
skipping to change at line 66 | skipping to change at line 66 | |||
uid_t uid, | uid_t uid, | |||
OutputFlags flags, | OutputFlags flags, | |||
bool system); | bool system); | |||
void json_escape( | void json_escape( | |||
FILE *f, | FILE *f, | |||
const char* p, | const char* p, | |||
size_t l, | size_t l, | |||
OutputFlags flags); | OutputFlags flags); | |||
const char* output_mode_to_string(OutputMode m); | const char* output_mode_to_string(OutputMode m) _const_; | |||
OutputMode output_mode_from_string(const char *s); | OutputMode output_mode_from_string(const char *s) _pure_; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 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 -*-*/ | |||
#pragma once | #pragma once | |||
#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 | #include "macro.h" | |||
l); | ||||
uint32_t jenkins_hashword(const uint32_t *k, size_t length, uint32_t initva | ||||
l) _pure_; | ||||
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) _pure_; | |||
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) _pure_; | |||
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; | |||
} | } | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 6 lines changed or added | |||
macro.h | macro.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#include <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))) | |||
#define _alloc_(...) __attribute__ ((alloc_size(__VA_ARGS__))) | ||||
#define _sentinel_ __attribute__ ((sentinel)) | #define _sentinel_ __attribute__ ((sentinel)) | |||
#define _noreturn_ __attribute__((noreturn)) | #define _noreturn_ __attribute__((noreturn)) | |||
#define _unused_ __attribute__ ((unused)) | #define _unused_ __attribute__ ((unused)) | |||
#define _destructor_ __attribute__ ((destructor)) | #define _destructor_ __attribute__ ((destructor)) | |||
#define _pure_ __attribute__ ((pure)) | #define _pure_ __attribute__ ((pure)) | |||
#define _const_ __attribute__ ((const)) | #define _const_ __attribute__ ((const)) | |||
#define _deprecated_ __attribute__ ((deprecated)) | #define _deprecated_ __attribute__ ((deprecated)) | |||
#define _packed_ __attribute__ ((packed)) | #define _packed_ __attribute__ ((packed)) | |||
#define _malloc_ __attribute__ ((malloc)) | #define _malloc_ __attribute__ ((malloc)) | |||
#define _weak_ __attribute__ ((weak)) | #define _weak_ __attribute__ ((weak)) | |||
skipping to change at line 267 | skipping to change at line 268 | |||
break; \ | break; \ | |||
case PA_DOUBLE|PA_FLAG_LONG_DOUBLE: \ | case PA_DOUBLE|PA_FLAG_LONG_DOUBLE: \ | |||
(void) va_arg(ap, long double); \ | (void) va_arg(ap, long double); \ | |||
break; \ | break; \ | |||
default: \ | default: \ | |||
assert_not_reached("Unknown format string argument. "); \ | assert_not_reached("Unknown format string argument. "); \ | |||
} \ | } \ | |||
} \ | } \ | |||
} while(false) | } while(false) | |||
/* Because statfs.t_type can be int on some architecures, we have to cast | ||||
* the const magic to the type, otherwise the compiler warns about | ||||
* signed/unsigned comparison, because the magic can be 32 bit unsigned. | ||||
*/ | ||||
#define F_TYPE_CMP(a, b) (a == (typeof(a)) b) | ||||
/* Returns the number of chars needed to format variables of the | /* Returns the number of chars needed to format variables of the | |||
* specified type as a decimal string. Adds in extra space for a | * specified type as a decimal string. Adds in extra space for a | |||
* negative '-' prefix. */ | * negative '-' prefix. */ | |||
#define DECIMAL_STR_MAX(type) \ | #define DECIMAL_STR_MAX(type) \ | |||
(1+(sizeof(type) <= 1 ? 3 : \ | (1+(sizeof(type) <= 1 ? 3 : \ | |||
sizeof(type) <= 2 ? 5 : \ | sizeof(type) <= 2 ? 5 : \ | |||
sizeof(type) <= 4 ? 10 : \ | sizeof(type) <= 4 ? 10 : \ | |||
sizeof(type) <= 8 ? 20 : sizeof(int[-2*(sizeof(type) > 8)]))) | sizeof(type) <= 8 ? 20 : sizeof(int[-2*(sizeof(type) > 8)]))) | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 7 lines changed or added | |||
manager.h | manager.h | |||
---|---|---|---|---|
skipping to change at line 287 | skipping to change at line 287 | |||
void manager_dispatch_bus_query_pid_done(Manager *m, const char *name, pid_ t pid); | void manager_dispatch_bus_query_pid_done(Manager *m, const char *name, pid_ t pid); | |||
int manager_open_serialization(Manager *m, FILE **_f); | int manager_open_serialization(Manager *m, FILE **_f); | |||
int manager_serialize(Manager *m, FILE *f, FDSet *fds, bool switching_root) ; | int manager_serialize(Manager *m, FILE *f, FDSet *fds, bool switching_root) ; | |||
int manager_deserialize(Manager *m, FILE *f, FDSet *fds); | int manager_deserialize(Manager *m, FILE *f, FDSet *fds); | |||
int manager_distribute_fds(Manager *m, FDSet *fds); | int manager_distribute_fds(Manager *m, FDSet *fds); | |||
int manager_reload(Manager *m); | int manager_reload(Manager *m); | |||
bool manager_is_reloading_or_reexecuting(Manager *m); | bool manager_is_reloading_or_reexecuting(Manager *m) _pure_; | |||
void manager_reset_failed(Manager *m); | void manager_reset_failed(Manager *m); | |||
void manager_send_unit_audit(Manager *m, Unit *u, int type, bool success); | void manager_send_unit_audit(Manager *m, Unit *u, int type, bool success); | |||
void manager_send_unit_plymouth(Manager *m, Unit *u); | void manager_send_unit_plymouth(Manager *m, Unit *u); | |||
bool manager_unit_pending_inactive(Manager *m, const char *name); | bool manager_unit_inactive_or_pending(Manager *m, const char *name); | |||
void manager_check_finished(Manager *m); | void manager_check_finished(Manager *m); | |||
void manager_run_generators(Manager *m); | void manager_run_generators(Manager *m); | |||
void manager_undo_generators(Manager *m); | void manager_undo_generators(Manager *m); | |||
void manager_recheck_journal(Manager *m); | void manager_recheck_journal(Manager *m); | |||
void manager_set_show_status(Manager *m, bool b); | void manager_set_show_status(Manager *m, bool b); | |||
void manager_status_printf(Manager *m, bool ephemeral, const char *status, const char *format, ...); | void manager_status_printf(Manager *m, bool ephemeral, const char *status, const char *format, ...) _printf_attr_(4,5); | |||
void watch_init(Watch *w); | void watch_init(Watch *w); | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
microhttpd-util.h | microhttpd-util.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#pragma once | #pragma once | |||
#include <stdarg.h> | #include <stdarg.h> | |||
void microhttpd_logger(void *arg, const char *fmt, va_list ap); | #include "macro.h" | |||
void microhttpd_logger(void *arg, const char *fmt, va_list ap) _printf_attr | ||||
_(2, 0); | ||||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
mount.h | mount.h | |||
---|---|---|---|---|
skipping to change at line 114 | skipping to change at line 114 | |||
MountExecCommand control_command_id; | MountExecCommand control_command_id; | |||
pid_t control_pid; | pid_t control_pid; | |||
Watch timer_watch; | Watch timer_watch; | |||
}; | }; | |||
extern const UnitVTable mount_vtable; | extern const UnitVTable mount_vtable; | |||
void mount_fd_event(Manager *m, int events); | void mount_fd_event(Manager *m, int events); | |||
const char* mount_state_to_string(MountState i); | const char* mount_state_to_string(MountState i) _const_; | |||
MountState mount_state_from_string(const char *s); | MountState mount_state_from_string(const char *s) _pure_; | |||
const char* mount_exec_command_to_string(MountExecCommand i); | const char* mount_exec_command_to_string(MountExecCommand i) _const_; | |||
MountExecCommand mount_exec_command_from_string(const char *s); | MountExecCommand mount_exec_command_from_string(const char *s) _pure_; | |||
const char* mount_result_to_string(MountResult i); | const char* mount_result_to_string(MountResult i) _const_; | |||
MountResult mount_result_from_string(const char *s); | MountResult mount_result_from_string(const char *s) _pure_; | |||
void warn_if_dir_nonempty(const char *unit, const char* where); | void warn_if_dir_nonempty(const char *unit, const char* where); | |||
End of changes. 3 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added | |||
pager.h | pager.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
WITHOUT ANY WARRANTY; without even the implied warranty of | WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include "macro.h" | ||||
int pager_open(bool jump_to_end); | int pager_open(bool jump_to_end); | |||
void pager_close(void); | void pager_close(void); | |||
bool pager_have(void); | bool pager_have(void) _pure_; | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 2 lines changed or added | |||
path-lookup.h | path-lookup.h | |||
---|---|---|---|---|
skipping to change at line 39 | skipping to change at line 39 | |||
#endif | #endif | |||
} LookupPaths; | } LookupPaths; | |||
typedef enum SystemdRunningAs { | typedef enum SystemdRunningAs { | |||
SYSTEMD_SYSTEM, | SYSTEMD_SYSTEM, | |||
SYSTEMD_USER, | SYSTEMD_USER, | |||
_SYSTEMD_RUNNING_AS_MAX, | _SYSTEMD_RUNNING_AS_MAX, | |||
_SYSTEMD_RUNNING_AS_INVALID = -1 | _SYSTEMD_RUNNING_AS_INVALID = -1 | |||
} SystemdRunningAs; | } SystemdRunningAs; | |||
const char* systemd_running_as_to_string(SystemdRunningAs i); | const char* systemd_running_as_to_string(SystemdRunningAs i) _const_; | |||
SystemdRunningAs systemd_running_as_from_string(const char *s); | SystemdRunningAs systemd_running_as_from_string(const char *s) _pure_; | |||
int user_config_home(char **config_home); | int user_config_home(char **config_home); | |||
int lookup_paths_init(LookupPaths *p, SystemdRunningAs running_as, bool per sonal, const char *generator, const char *generator_early, const char *gene rator_late); | int lookup_paths_init(LookupPaths *p, SystemdRunningAs 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); | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
path-util.h | path-util.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
systemd is distributed in the hope that it will be useful, but | systemd is distributed in the hope that it will be useful, but | |||
WITHOUT ANY WARRANTY; without even the implied warranty of | WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#include "stdbool.h" | #include <stdbool.h> | |||
bool is_path(const char *p); | #include "macro.h" | |||
char **path_split_and_make_absolute(const char *p); | ||||
char *path_get_file_name(const char *p); | bool is_path(const char *p) _pure_; | |||
char** path_split_and_make_absolute(const char *p); | ||||
char* path_get_file_name(const char *p) _pure_; | ||||
int path_get_parent(const char *path, char **parent); | int path_get_parent(const char *path, char **parent); | |||
bool path_is_absolute(const char *p); | bool path_is_absolute(const char *p) _pure_; | |||
char *path_make_absolute(const char *p, const char *prefix); | char* path_make_absolute(const char *p, const char *prefix); | |||
char *path_make_absolute_cwd(const char *p); | char* path_make_absolute_cwd(const char *p); | |||
char *path_kill_slashes(char *path); | char* path_kill_slashes(char *path); | |||
char *path_startswith(const char *path, const char *prefix); | char* path_startswith(const char *path, const char *prefix) _pure_; | |||
bool path_equal(const char *a, const char *b); | bool path_equal(const char *a, const char *b) _pure_; | |||
char **path_strv_make_absolute_cwd(char **l); | char** path_strv_make_absolute_cwd(char **l); | |||
char **path_strv_canonicalize(char **l); | char** path_strv_canonicalize(char **l); | |||
char **path_strv_canonicalize_uniq(char **l); | char** path_strv_canonicalize_uniq(char **l); | |||
int path_is_mount_point(const char *path, bool allow_symlink); | int path_is_mount_point(const char *path, bool allow_symlink); | |||
int path_is_read_only_fs(const char *path); | int path_is_read_only_fs(const char *path); | |||
int path_is_os_tree(const char *path); | int path_is_os_tree(const char *path); | |||
End of changes. 3 change blocks. | ||||
14 lines changed or deleted | 16 lines changed or added | |||
path.h | path.h | |||
---|---|---|---|---|
skipping to change at line 83 | skipping to change at line 83 | |||
PATH_FAILURE_RESOURCES, | PATH_FAILURE_RESOURCES, | |||
_PATH_RESULT_MAX, | _PATH_RESULT_MAX, | |||
_PATH_RESULT_INVALID = -1 | _PATH_RESULT_INVALID = -1 | |||
} PathResult; | } PathResult; | |||
struct Path { | struct Path { | |||
Unit meta; | Unit meta; | |||
LIST_HEAD(PathSpec, specs); | LIST_HEAD(PathSpec, specs); | |||
UnitRef unit; | ||||
PathState state, deserialized_state; | PathState state, deserialized_state; | |||
bool inotify_triggered; | bool inotify_triggered; | |||
bool make_directory; | bool make_directory; | |||
mode_t directory_mode; | mode_t directory_mode; | |||
PathResult result; | PathResult result; | |||
}; | }; | |||
void path_unit_notify(Unit *u, UnitActiveState new_state); | ||||
/* Called from the mount code figure out if a mount is a dependency of | /* Called from the mount code figure out if a mount is a dependency of | |||
* any of the paths of this path object */ | * any of the paths of this path object */ | |||
int path_add_one_mount_link(Path *p, Mount *m); | int path_add_one_mount_link(Path *p, Mount *m); | |||
void path_free_specs(Path *p); | void path_free_specs(Path *p); | |||
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) _const_; | |||
PathState path_state_from_string(const char *s); | PathState path_state_from_string(const char *s) _pure_; | |||
const char* path_type_to_string(PathType i); | const char* path_type_to_string(PathType i) _const_; | |||
PathType path_type_from_string(const char *s); | PathType path_type_from_string(const char *s) _pure_; | |||
const char* path_result_to_string(PathResult i); | const char* path_result_to_string(PathResult i) _const_; | |||
PathResult path_result_from_string(const char *s); | PathResult path_result_from_string(const char *s) _pure_; | |||
End of changes. 5 change blocks. | ||||
8 lines changed or deleted | 4 lines changed or added | |||
prioq.h | prioq.h | |||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
typedef struct Prioq Prioq; | typedef struct Prioq Prioq; | |||
Prioq *prioq_new(compare_func_t compare); | Prioq *prioq_new(compare_func_t compare); | |||
void prioq_free(Prioq *q); | void prioq_free(Prioq *q); | |||
int prioq_ensure_allocated(Prioq **q, compare_func_t compare_func); | int prioq_ensure_allocated(Prioq **q, compare_func_t compare_func); | |||
int prioq_put(Prioq *q, void *data, unsigned *idx); | int prioq_put(Prioq *q, void *data, unsigned *idx); | |||
int prioq_remove(Prioq *q, void *data, unsigned *idx); | int prioq_remove(Prioq *q, void *data, unsigned *idx); | |||
int prioq_reshuffle(Prioq *q, void *data, unsigned *idx); | int prioq_reshuffle(Prioq *q, void *data, unsigned *idx); | |||
void *prioq_peek(Prioq *q); | void *prioq_peek(Prioq *q) _pure_; | |||
void *prioq_pop(Prioq *q); | void *prioq_pop(Prioq *q); | |||
unsigned prioq_size(Prioq *q); | unsigned prioq_size(Prioq *q) _pure_; | |||
bool prioq_isempty(Prioq *q); | bool prioq_isempty(Prioq *q) _pure_; | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
sd-bus.h | sd-bus.h | |||
---|---|---|---|---|
skipping to change at line 35 | skipping to change at line 35 | |||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <sd-id128.h> | #include <sd-id128.h> | |||
#include "sd-bus-protocol.h" | #include "sd-bus-protocol.h" | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
#ifndef _sd_printf_attr_ | ||||
# if __GNUC__ >= 4 | ||||
# define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) | ||||
# else | ||||
# define _sd_printf_attr_(a,b) | ||||
# endif | ||||
#endif | ||||
/* TODO: | /* TODO: | |||
* - add page donation logic | * - add page donation logic | |||
* - api for appending/reading fixed arrays | * - api for appending/reading fixed arrays | |||
* - merge busctl into systemctl or so? | * - merge busctl into systemctl or so? | |||
* - default policy (allow uid == 0 and our own uid) | * - default policy (allow uid == 0 and our own uid) | |||
* | * | |||
* - enforce alignment of pointers passed in | * - enforce alignment of pointers passed in | |||
* - negotiation for attach attributes | * - negotiation for attach attributes | |||
* | ||||
* - for kernel and unix transports allow setting the unix user/access mode | ||||
for the node | ||||
*/ | */ | |||
typedef struct sd_bus sd_bus; | typedef struct sd_bus sd_bus; | |||
typedef struct sd_bus_message sd_bus_message; | typedef struct sd_bus_message sd_bus_message; | |||
typedef struct { | typedef struct { | |||
const char *name; | const char *name; | |||
const char *message; | const char *message; | |||
int need_free; | int need_free; | |||
} sd_bus_error; | } sd_bus_error; | |||
skipping to change at line 142 | skipping to change at line 152 | |||
int sd_bus_message_get_pid_starttime(sd_bus_message *m, uint64_t *usec); | int sd_bus_message_get_pid_starttime(sd_bus_message *m, uint64_t *usec); | |||
int sd_bus_message_get_selinux_context(sd_bus_message *m, const char **r); | int sd_bus_message_get_selinux_context(sd_bus_message *m, const char **r); | |||
int sd_bus_message_get_comm(sd_bus_message *m, const char **r); | int sd_bus_message_get_comm(sd_bus_message *m, const char **r); | |||
int sd_bus_message_get_tid_comm(sd_bus_message *m, const char **r); | int sd_bus_message_get_tid_comm(sd_bus_message *m, const char **r); | |||
int sd_bus_message_get_exe(sd_bus_message *m, const char **r); | int sd_bus_message_get_exe(sd_bus_message *m, const char **r); | |||
int sd_bus_message_get_cgroup(sd_bus_message *m, const char **r); | int sd_bus_message_get_cgroup(sd_bus_message *m, const char **r); | |||
int sd_bus_message_get_cmdline(sd_bus_message *m, char ***cmdline); | int sd_bus_message_get_cmdline(sd_bus_message *m, char ***cmdline); | |||
int sd_bus_message_get_unit(sd_bus_message *m, const char **unit); | int sd_bus_message_get_unit(sd_bus_message *m, const char **unit); | |||
int sd_bus_message_get_user_unit(sd_bus_message *m, const char **unit); | int sd_bus_message_get_user_unit(sd_bus_message *m, const char **unit); | |||
int sd_bus_message_get_session(sd_bus_message *m, const char **session); | int sd_bus_message_get_session(sd_bus_message *m, const char **session); | |||
int sd_bus_message_get_owner_uid(sd_bus_message *m, uid_t *uid); | ||||
int sd_bus_message_get_audit_sessionid(sd_bus_message *m, uint32_t *session | ||||
id); | ||||
int sd_bus_message_get_audit_loginuid(sd_bus_message *m, uid_t *loginuid); | ||||
int sd_bus_message_has_effective_cap(sd_bus_message *m, int capability); | ||||
int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, cons t char *member); | int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, cons t char *member); | |||
int sd_bus_message_is_method_call(sd_bus_message *m, const char *interface, const char *member); | int sd_bus_message_is_method_call(sd_bus_message *m, const char *interface, const char *member); | |||
int sd_bus_message_is_method_error(sd_bus_message *m, const char *name); | int sd_bus_message_is_method_error(sd_bus_message *m, const char *name); | |||
int sd_bus_message_set_no_reply(sd_bus_message *m, int b); | int sd_bus_message_set_no_reply(sd_bus_message *m, int b); | |||
int sd_bus_message_set_destination(sd_bus_message *m, const char *destinati on); | int sd_bus_message_set_destination(sd_bus_message *m, const char *destinati on); | |||
int sd_bus_message_append(sd_bus_message *m, const char *types, ...); | int sd_bus_message_append(sd_bus_message *m, const char *types, ...); | |||
int sd_bus_message_append_basic(sd_bus_message *m, char type, const void *p ); | int sd_bus_message_append_basic(sd_bus_message *m, char type, const void *p ); | |||
skipping to change at line 178 | skipping to change at line 192 | |||
/* Bus management */ | /* Bus management */ | |||
int sd_bus_get_unique_name(sd_bus *bus, const char **unique); | int sd_bus_get_unique_name(sd_bus *bus, const char **unique); | |||
int sd_bus_request_name(sd_bus *bus, const char *name, int flags); | int sd_bus_request_name(sd_bus *bus, const char *name, int flags); | |||
int sd_bus_release_name(sd_bus *bus, const char *name); | int sd_bus_release_name(sd_bus *bus, const char *name); | |||
int sd_bus_list_names(sd_bus *bus, char ***l); | int sd_bus_list_names(sd_bus *bus, char ***l); | |||
int sd_bus_get_owner(sd_bus *bus, const char *name, char **owner); | int sd_bus_get_owner(sd_bus *bus, const char *name, char **owner); | |||
int sd_bus_get_owner_uid(sd_bus *bus, const char *name, uid_t *uid); | int sd_bus_get_owner_uid(sd_bus *bus, const char *name, uid_t *uid); | |||
int sd_bus_get_owner_pid(sd_bus *bus, const char *name, pid_t *pid); | int sd_bus_get_owner_pid(sd_bus *bus, const char *name, pid_t *pid); | |||
int sd_bus_get_owner_machine_id(sd_bus *bus, const char *name, sd_id128_t * machine); | ||||
/* Error structures */ | /* Error structures */ | |||
#define SD_BUS_ERROR_NULL ((sd_bus_error) {NULL, NULL, 0}) | #define SD_BUS_ERROR_NULL ((sd_bus_error) {NULL, NULL, 0}) | |||
#define SD_BUS_ERROR_MAKE(name, message) ((sd_bus_error) {(name), (message) , 0}) | #define SD_BUS_ERROR_MAKE(name, message) ((sd_bus_error) {(name), (message) , 0}) | |||
void sd_bus_error_free(sd_bus_error *e); | void sd_bus_error_free(sd_bus_error *e); | |||
int sd_bus_error_set(sd_bus_error *e, const char *name, const char *format, ...); | int sd_bus_error_set(sd_bus_error *e, const char *name, const char *format, ...) _sd_printf_attr_(3, 0); | |||
void sd_bus_error_set_const(sd_bus_error *e, const char *name, const char * message); | void sd_bus_error_set_const(sd_bus_error *e, const char *name, const char * message); | |||
int sd_bus_error_copy(sd_bus_error *dest, const sd_bus_error *e); | int sd_bus_error_copy(sd_bus_error *dest, const sd_bus_error *e); | |||
int sd_bus_error_is_set(const sd_bus_error *e); | int sd_bus_error_is_set(const sd_bus_error *e); | |||
int sd_bus_error_has_name(const sd_bus_error *e, const char *name); | int sd_bus_error_has_name(const sd_bus_error *e, const char *name); | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
#endif | #endif | |||
End of changes. 5 change blocks. | ||||
1 lines changed or deleted | 18 lines changed or added | |||
sd-daemon.h | sd-daemon.h | |||
---|---|---|---|---|
skipping to change at line 71 | skipping to change at line 71 | |||
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/libsystemd-daemon/s d-daemon.c | http://cgit.freedesktop.org/systemd/systemd/plain/src/libsystemd-daemon/s d-daemon.c | |||
This should compile on non-Linux systems, too, but with the | 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(3) 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 | |||
/* | /* | |||
Log levels for usage on stderr: | Log levels for usage on stderr: | |||
fprintf(stderr, SD_NOTICE "Hello World!\n"); | fprintf(stderr, SD_NOTICE "Hello World!\n"); | |||
This is similar to printk() usage in the kernel. | This is similar to printk() usage in the kernel. | |||
*/ | */ | |||
#define SD_EMERG "<0>" /* system is unusable */ | #define SD_EMERG "<0>" /* system is unusable */ | |||
End of changes. 1 change blocks. | ||||
5 lines changed or deleted | 5 lines changed or added | |||
sd-id128.h | sd-id128.h | |||
---|---|---|---|---|
skipping to change at line 43 | skipping to change at line 43 | |||
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, sd_id128_t *ret); | |||
int sd_id128_randomize(sd_id128_t *ret); | int sd_id128_randomize(sd_id128_t *ret); | |||
int sd_id128_get_machine(sd_id128_t *ret); | int sd_id128_get_machine(sd_id128_t *ret); | |||
int sd_id128_get_boot(sd_id128_t *ret); | int sd_id128_get_boot(sd_id128_t *ret); | |||
#define SD_ID128_MAKE(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12 , v13, v14, v15) \ | #define SD_ID128_MAKE(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12 , v13, v14, v15) \ | |||
((sd_id128_t) { .bytes = { 0x##v0, 0x##v1, 0x##v2, 0x##v3, 0x##v4, 0x##v5, 0x##v6, 0x##v7, \ | ((sd_id128_t) { .bytes = { 0x##v0, 0x##v1, 0x##v2, 0x##v3, 0x##v4, 0x##v5, 0x##v6, 0x##v7, \ | |||
0x##v8, 0x##v9, 0x##v10, 0x##v11, 0x##v1 2, 0x##v13, 0x##v14, 0x##v15 }}) | 0x##v8, 0x##v9, 0x##v10, 0x##v11, 0x##v1 2, 0x##v13, 0x##v14, 0x##v15 }}) | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
sd-journal.h | sd-journal.h | |||
---|---|---|---|---|
skipping to change at line 37 | skipping to change at line 37 | |||
#include <stdarg.h> | #include <stdarg.h> | |||
#include <sys/uio.h> | #include <sys/uio.h> | |||
#include <syslog.h> | #include <syslog.h> | |||
#include <systemd/sd-id128.h> | #include <systemd/sd-id128.h> | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
#ifndef _sd_printf_attr_ | ||||
# if __GNUC__ >= 4 | ||||
# define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) | ||||
# else | ||||
# define _sd_printf_attr_(a,b) | ||||
# endif | ||||
#endif | ||||
#ifndef _sd_sentinel_attr_ | ||||
# define _sd_sentinel_attr_ __attribute__((sentinel)) | ||||
#endif | ||||
/* Journal APIs. See sd-journal(3) for more information. */ | /* Journal APIs. See sd-journal(3) for more information. */ | |||
/* Write to daemon */ | /* Write to daemon */ | |||
int sd_journal_print(int priority, const char *format, ...) __attribute__ ( | int sd_journal_print(int priority, const char *format, ...) _sd_printf_attr | |||
(format (printf, 2, 3))); | _(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) _sd_pri | |||
int sd_journal_send(const char *format, ...) __attribute__((sentinel)); | ntf_attr_(2, 0); | |||
int sd_journal_send(const char *format, ...) _sd_printf_attr_(1, 0) _sd_sen | ||||
tinel_attr_; | ||||
int sd_journal_sendv(const struct iovec *iov, int n); | int sd_journal_sendv(const struct iovec *iov, int n); | |||
int sd_journal_perror(const char *message); | int sd_journal_perror(const char *message); | |||
/* Used by the macros below. Don't call this directly. */ | /* Used by the macros below. Don't call this directly. */ | |||
int sd_journal_print_with_location(int priority, const char *file, const ch | int sd_journal_print_with_location(int priority, const char *file, const ch | |||
ar *line, const char *func, const char *format, ...) __attribute__ ((format | ar *line, const char *func, const char *format, ...) _sd_printf_attr_(5, 6) | |||
(printf, 5, 6))); | ; | |||
int sd_journal_printv_with_location(int priority, const char *file, const c | int sd_journal_printv_with_location(int priority, const char *file, const c | |||
har *line, const char *func, const char *format, va_list ap); | har *line, const char *func, const char *format, va_list ap) _sd_printf_att | |||
int sd_journal_send_with_location(const char *file, const char *line, const | r_(5, 0); | |||
char *func, const char *format, ...) __attribute__((sentinel)); | int sd_journal_send_with_location(const char *file, const char *line, const | |||
char *func, const char *format, ...) _sd_printf_attr_(4, 0) _sd_sentinel_a | ||||
ttr_; | ||||
int sd_journal_sendv_with_location(const char *file, const char *line, cons t char *func, const struct iovec *iov, int n); | int sd_journal_sendv_with_location(const char *file, const char *line, cons t char *func, const struct iovec *iov, int n); | |||
int sd_journal_perror_with_location(const char *file, const char *line, con st char *func, const char *message); | int sd_journal_perror_with_location(const char *file, const char *line, con st char *func, const char *message); | |||
/* implicitly add code location to messages sent, if this is enabled */ | /* implicitly add code location to messages sent, if this is enabled */ | |||
#ifndef SD_JOURNAL_SUPPRESS_LOCATION | #ifndef SD_JOURNAL_SUPPRESS_LOCATION | |||
#define _sd_XSTRINGIFY(x) #x | #define _sd_XSTRINGIFY(x) #x | |||
#define _sd_STRINGIFY(x) _sd_XSTRINGIFY(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_print(priority, ...) sd_journal_print_with_location(prio rity, "CODE_FILE=" __FILE__, "CODE_LINE=" _sd_STRINGIFY(__LINE__), __func__ , __VA_ARGS__) | |||
End of changes. 3 change blocks. | ||||
11 lines changed or deleted | 27 lines changed or added | |||
sd-login.h | sd-login.h | |||
---|---|---|---|---|
skipping to change at line 153 | skipping to change at line 153 | |||
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. */ | |||
int sd_get_uids(uid_t **users); | int sd_get_uids(uid_t **users); | |||
/* Get all running virtual machines/containers */ | ||||
int sd_get_machine_names(char ***machines); | ||||
/* Monitor object */ | /* Monitor object */ | |||
typedef struct sd_login_monitor sd_login_monitor; | typedef struct sd_login_monitor sd_login_monitor; | |||
/* Create a new monitor. Category must be NULL, "seat", "session", | /* Create a new monitor. Category must be NULL, "seat", "session", | |||
* "uid" to get monitor events for the specific category (or all). */ | * "uid", "machine" to get monitor events for the specific category | |||
* (or all). */ | ||||
int sd_login_monitor_new(const char *category, sd_login_monitor** ret); | int sd_login_monitor_new(const char *category, sd_login_monitor** ret); | |||
/* Destroys the passed monitor. Returns NULL. */ | /* Destroys the passed monitor. Returns NULL. */ | |||
sd_login_monitor* sd_login_monitor_unref(sd_login_monitor *m); | sd_login_monitor* sd_login_monitor_unref(sd_login_monitor *m); | |||
/* Flushes the monitor */ | /* Flushes the monitor */ | |||
int sd_login_monitor_flush(sd_login_monitor *m); | int sd_login_monitor_flush(sd_login_monitor *m); | |||
/* Get FD from monitor */ | /* Get FD from monitor */ | |||
int sd_login_monitor_get_fd(sd_login_monitor *m); | int sd_login_monitor_get_fd(sd_login_monitor *m); | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 5 lines changed or added | |||
service.h | service.h | |||
---|---|---|---|---|
skipping to change at line 206 | skipping to change at line 206 | |||
NotifyAccess notify_access; | NotifyAccess notify_access; | |||
}; | }; | |||
extern const UnitVTable service_vtable; | extern const UnitVTable service_vtable; | |||
struct Socket; | struct Socket; | |||
int service_set_socket_fd(Service *s, int fd, struct Socket *socket); | int service_set_socket_fd(Service *s, int fd, struct Socket *socket); | |||
const char* service_state_to_string(ServiceState i); | const char* service_state_to_string(ServiceState i) _const_; | |||
ServiceState service_state_from_string(const char *s); | ServiceState service_state_from_string(const char *s) _pure_; | |||
const char* service_restart_to_string(ServiceRestart i); | const char* service_restart_to_string(ServiceRestart i) _const_; | |||
ServiceRestart service_restart_from_string(const char *s); | ServiceRestart service_restart_from_string(const char *s) _pure_; | |||
const char* service_type_to_string(ServiceType i); | const char* service_type_to_string(ServiceType i) _const_; | |||
ServiceType service_type_from_string(const char *s); | ServiceType service_type_from_string(const char *s) _pure_; | |||
const char* service_exec_command_to_string(ServiceExecCommand i); | const char* service_exec_command_to_string(ServiceExecCommand i) _const_; | |||
ServiceExecCommand service_exec_command_from_string(const char *s); | ServiceExecCommand service_exec_command_from_string(const char *s) _pure_; | |||
const char* notify_access_to_string(NotifyAccess i); | const char* notify_access_to_string(NotifyAccess i) _const_; | |||
NotifyAccess notify_access_from_string(const char *s); | NotifyAccess notify_access_from_string(const char *s) _pure_; | |||
const char* service_result_to_string(ServiceResult i); | const char* service_result_to_string(ServiceResult i) _const_; | |||
ServiceResult service_result_from_string(const char *s); | ServiceResult service_result_from_string(const char *s) _pure_; | |||
const char* start_limit_action_to_string(StartLimitAction i); | const char* start_limit_action_to_string(StartLimitAction i) _const_; | |||
StartLimitAction start_limit_action_from_string(const char *s); | StartLimitAction start_limit_action_from_string(const char *s) _pure_; | |||
End of changes. 7 change blocks. | ||||
12 lines changed or deleted | 12 lines changed or added | |||
set.h | set.h | |||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
void set_free_free(Set *s); | void set_free_free(Set *s); | |||
static inline void set_free_freep(Set **s) { | static inline void set_free_freep(Set **s) { | |||
set_free_free(*s); | set_free_free(*s); | |||
} | } | |||
Set* set_copy(Set *s); | Set* set_copy(Set *s); | |||
int set_ensure_allocated(Set **s, hash_func_t hash_func, compare_func_t com pare_func); | int set_ensure_allocated(Set **s, hash_func_t hash_func, compare_func_t com pare_func); | |||
int set_put(Set *s, void *value); | int set_put(Set *s, void *value); | |||
int set_consume(Set *s, void *value); | ||||
int set_replace(Set *s, void *value); | int set_replace(Set *s, void *value); | |||
void *set_get(Set *s, void *value); | void *set_get(Set *s, void *value); | |||
bool set_contains(Set *s, void *value); | bool set_contains(Set *s, void *value); | |||
void *set_remove(Set *s, void *value); | void *set_remove(Set *s, void *value); | |||
int set_remove_and_put(Set *s, void *old_value, void *new_value); | int set_remove_and_put(Set *s, void *old_value, void *new_value); | |||
int set_merge(Set *s, Set *other); | int set_merge(Set *s, Set *other); | |||
void set_move(Set *s, Set *other); | void set_move(Set *s, Set *other); | |||
int set_move_one(Set *s, Set *other, void *value); | int set_move_one(Set *s, Set *other, void *value); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
snapshot.h | snapshot.h | |||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
bool cleanup; | bool cleanup; | |||
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) _const_; | |||
SnapshotState snapshot_state_from_string(const char *s); | SnapshotState snapshot_state_from_string(const char *s) _pure_; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
socket-util.h | socket-util.h | |||
---|---|---|---|---|
skipping to change at line 70 | skipping to change at line 70 | |||
SOCKET_ADDRESS_IPV6_ONLY, | SOCKET_ADDRESS_IPV6_ONLY, | |||
_SOCKET_ADDRESS_BIND_IPV6_ONLY_MAX, | _SOCKET_ADDRESS_BIND_IPV6_ONLY_MAX, | |||
_SOCKET_ADDRESS_BIND_IPV6_ONLY_INVALID = -1 | _SOCKET_ADDRESS_BIND_IPV6_ONLY_INVALID = -1 | |||
} SocketAddressBindIPv6Only; | } SocketAddressBindIPv6Only; | |||
#define socket_address_family(a) ((a)->sockaddr.sa.sa_family) | #define socket_address_family(a) ((a)->sockaddr.sa.sa_family) | |||
int socket_address_parse(SocketAddress *a, const char *s); | int socket_address_parse(SocketAddress *a, const char *s); | |||
int socket_address_parse_netlink(SocketAddress *a, const char *s); | int socket_address_parse_netlink(SocketAddress *a, const char *s); | |||
int socket_address_print(const SocketAddress *a, char **p); | int socket_address_print(const SocketAddress *a, char **p); | |||
int socket_address_verify(const SocketAddress *a); | int socket_address_verify(const SocketAddress *a) _pure_; | |||
bool socket_address_can_accept(const SocketAddress *a); | bool socket_address_can_accept(const SocketAddress *a) _pure_; | |||
int socket_address_listen( | int socket_address_listen( | |||
const SocketAddress *a, | const SocketAddress *a, | |||
int backlog, | int backlog, | |||
SocketAddressBindIPv6Only only, | SocketAddressBindIPv6Only only, | |||
const char *bind_to_device, | const char *bind_to_device, | |||
bool free_bind, | bool free_bind, | |||
bool transparent, | bool transparent, | |||
mode_t directory_mode, | mode_t directory_mode, | |||
mode_t socket_mode, | mode_t socket_mode, | |||
const char *label, | const char *label, | |||
int *ret); | int *ret); | |||
bool socket_address_is(const SocketAddress *a, const char *s, int type); | bool socket_address_is(const SocketAddress *a, const char *s, int type); | |||
bool socket_address_is_netlink(const SocketAddress *a, const char *s); | bool socket_address_is_netlink(const SocketAddress *a, const char *s); | |||
bool socket_address_matches_fd(const SocketAddress *a, int fd); | bool socket_address_matches_fd(const SocketAddress *a, int fd); | |||
int make_socket_fd(const char* address, int flags); | int make_socket_fd(const char* address, int flags); | |||
bool socket_address_equal(const SocketAddress *a, const SocketAddress *b); | bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) _ pure_; | |||
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 | const char* socket_address_bind_ipv6_only_to_string(SocketAddressBindIPv6On | |||
ly b); | ly b) _const_; | |||
SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const c | SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const c | |||
har *s); | har *s) _pure_; | |||
int netlink_family_to_string_alloc(int b, char **s); | int netlink_family_to_string_alloc(int b, char **s); | |||
int netlink_family_from_string(const char *s); | int netlink_family_from_string(const char *s); | |||
bool socket_ipv6_is_supported(void); | bool socket_ipv6_is_supported(void); | |||
End of changes. 4 change blocks. | ||||
7 lines changed or deleted | 7 lines changed or added | |||
socket.h | socket.h | |||
---|---|---|---|---|
skipping to change at line 170 | skipping to change at line 170 | |||
* any of the sockets of this socket */ | * any of the sockets of this socket */ | |||
int socket_add_one_mount_link(Socket *s, Mount *m); | int socket_add_one_mount_link(Socket *s, Mount *m); | |||
/* Called from the service code when a per-connection service ended */ | /* Called from the service code when a per-connection service ended */ | |||
void socket_connection_unref(Socket *s); | void socket_connection_unref(Socket *s); | |||
void socket_free_ports(Socket *s); | void socket_free_ports(Socket *s); | |||
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) _const_; | |||
SocketState socket_state_from_string(const char *s); | SocketState socket_state_from_string(const char *s) _pure_; | |||
const char* socket_exec_command_to_string(SocketExecCommand i); | const char* socket_exec_command_to_string(SocketExecCommand i) _const_; | |||
SocketExecCommand socket_exec_command_from_string(const char *s); | SocketExecCommand socket_exec_command_from_string(const char *s) _pure_; | |||
const char* socket_result_to_string(SocketResult i); | const char* socket_result_to_string(SocketResult i) _const_; | |||
SocketResult socket_result_from_string(const char *s); | SocketResult socket_result_from_string(const char *s) _pure_; | |||
const char* socket_port_type_to_string(SocketPort *p); | const char* socket_port_type_to_string(SocketPort *p) _pure_; | |||
End of changes. 4 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added | |||
store.h | store.h | |||
---|---|---|---|---|
skipping to change at line 28 | skipping to change at line 28 | |||
systemd is distributed in the hope that it will be useful, but | systemd is distributed in the hope that it will be useful, but | |||
WITHOUT ANY WARRANTY; without even the implied warranty of | WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#include <dirent.h> | #include <dirent.h> | |||
#include "bootchart.h" | ||||
extern DIR *proc; | extern DIR *proc; | |||
extern int procfd; | extern int procfd; | |||
double gettime_ns(void); | double gettime_ns(void); | |||
void log_uptime(void); | void log_uptime(void); | |||
void log_sample(int sample); | void log_sample(int sample, struct list_sample_data **ptr); | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
strv.h | strv.h | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#include <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) _pure_; | |||
char *strv_find_prefix(char **l, const char *name); | char *strv_find_prefix(char **l, const char *name) _pure_; | |||
void strv_free(char **l); | void strv_free(char **l); | |||
static inline void strv_freep(char ***l) { | static inline void strv_freep(char ***l) { | |||
strv_free(*l); | strv_free(*l); | |||
} | } | |||
#define _cleanup_strv_free_ _cleanup_(strv_freep) | #define _cleanup_strv_free_ _cleanup_(strv_freep) | |||
char **strv_copy(char * const *l) _malloc_; | char **strv_copy(char * const *l); | |||
unsigned strv_length(char * const *l); | unsigned strv_length(char * const *l) _pure_; | |||
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); | |||
int strv_extend(char ***l, const char *value); | int strv_extend(char ***l, const char *value); | |||
int strv_push(char ***l, char *value); | int strv_push(char ***l, char *value); | |||
char **strv_remove(char **l, const char *s); | char **strv_remove(char **l, const char *s); | |||
char **strv_remove_prefix(char **l, const char *s); | char **strv_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_; | |||
char **strv_new_ap(const char *x, va_list ap) _malloc_; | char **strv_new_ap(const char *x, va_list ap); | |||
static inline const char* STRV_IFNOTNULL(const char *x) { | static inline const char* STRV_IFNOTNULL(const char *x) { | |||
return x ? x : (const char *) -1; | return x ? x : (const char *) -1; | |||
} | } | |||
static inline bool strv_isempty(char * const *l) { | static inline bool strv_isempty(char * const *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); | |||
char **strv_split_quoted(const char *s) _malloc_; | char **strv_split_quoted(const char *s); | |||
char **strv_split_newlines(const char *s) _malloc_; | char **strv_split_newlines(const char *s); | |||
char *strv_join(char **l, const char *separator) _malloc_; | char *strv_join(char **l, const char *separator); | |||
char **strv_parse_nulstr(const char *s, size_t l); | char **strv_parse_nulstr(const char *s, size_t l); | |||
char **strv_split_nulstr(const char *s); | char **strv_split_nulstr(const char *s); | |||
bool strv_overlap(char **a, char **b); | bool strv_overlap(char **a, char **b) _pure_; | |||
#define STRV_FOREACH(s, l) \ | #define STRV_FOREACH(s, l) \ | |||
for ((s) = (l); (s) && *(s); (s)++) | for ((s) = (l); (s) && *(s); (s)++) | |||
#define STRV_FOREACH_BACKWARDS(s, l) \ | #define STRV_FOREACH_BACKWARDS(s, l) \ | |||
for (; (l) && ((s) >= (l)); (s)--) | for (; (l) && ((s) >= (l)); (s)--) | |||
#define STRV_FOREACH_PAIR(x, y, l) \ | #define STRV_FOREACH_PAIR(x, y, l) \ | |||
for ((x) = (l), (y) = (x+1); (x) && *(x) && *(y); (x) += 2, (y) = ( x + 1)) | for ((x) = (l), (y) = (x+1); (x) && *(x) && *(y); (x) += 2, (y) = ( x + 1)) | |||
End of changes. 6 change blocks. | ||||
11 lines changed or deleted | 11 lines changed or added | |||
swap.h | swap.h | |||
---|---|---|---|---|
skipping to change at line 114 | skipping to change at line 114 | |||
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_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) _const_; | |||
SwapState swap_state_from_string(const char *s); | SwapState swap_state_from_string(const char *s) _pure_; | |||
const char* swap_exec_command_to_string(SwapExecCommand i); | const char* swap_exec_command_to_string(SwapExecCommand i) _const_; | |||
SwapExecCommand swap_exec_command_from_string(const char *s); | SwapExecCommand swap_exec_command_from_string(const char *s) _pure_; | |||
const char* swap_result_to_string(SwapResult i); | const char* swap_result_to_string(SwapResult i) _const_; | |||
SwapResult swap_result_from_string(const char *s); | SwapResult swap_result_from_string(const char *s) _pure_; | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
target.h | target.h | |||
---|---|---|---|---|
skipping to change at line 43 | skipping to change at line 43 | |||
} TargetState; | } TargetState; | |||
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) _const_; | |||
TargetState target_state_from_string(const char *s); | TargetState target_state_from_string(const char *s) _pure_; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||
time-util.h | time-util.h | |||
---|---|---|---|---|
skipping to change at line 69 | skipping to change at line 69 | |||
#define FORMAT_TIMESPAN_MAX 64 | #define FORMAT_TIMESPAN_MAX 64 | |||
usec_t now(clockid_t clock); | usec_t now(clockid_t clock); | |||
dual_timestamp* dual_timestamp_get(dual_timestamp *ts); | dual_timestamp* dual_timestamp_get(dual_timestamp *ts); | |||
dual_timestamp* dual_timestamp_from_realtime(dual_timestamp *ts, usec_t u); | dual_timestamp* dual_timestamp_from_realtime(dual_timestamp *ts, usec_t u); | |||
dual_timestamp* dual_timestamp_from_monotonic(dual_timestamp *ts, usec_t u) ; | dual_timestamp* dual_timestamp_from_monotonic(dual_timestamp *ts, usec_t u) ; | |||
#define dual_timestamp_is_set(ts) ((ts)->realtime > 0) | #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) _pure_; | |||
struct timespec *timespec_store(struct timespec *ts, usec_t u); | struct timespec *timespec_store(struct timespec *ts, usec_t u); | |||
usec_t timeval_load(const struct timeval *tv); | usec_t timeval_load(const struct timeval *tv) _pure_; | |||
struct timeval *timeval_store(struct timeval *tv, usec_t u); | struct timeval *timeval_store(struct timeval *tv, usec_t u); | |||
char *format_timestamp(char *buf, size_t l, usec_t t); | char *format_timestamp(char *buf, size_t l, usec_t t); | |||
char *format_timestamp_relative(char *buf, size_t l, usec_t t); | char *format_timestamp_relative(char *buf, size_t l, usec_t t); | |||
char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy); | char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy); | |||
void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t) ; | void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t) ; | |||
void dual_timestamp_deserialize(const char *value, dual_timestamp *t); | void dual_timestamp_deserialize(const char *value, dual_timestamp *t); | |||
int parse_timestamp(const char *t, usec_t *usec); | int parse_timestamp(const char *t, usec_t *usec); | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
timer.h | timer.h | |||
---|---|---|---|---|
skipping to change at line 77 | skipping to change at line 77 | |||
} TimerResult; | } TimerResult; | |||
struct Timer { | struct Timer { | |||
Unit meta; | Unit meta; | |||
LIST_HEAD(TimerValue, values); | LIST_HEAD(TimerValue, values); | |||
usec_t next_elapse_monotonic; | usec_t next_elapse_monotonic; | |||
usec_t next_elapse_realtime; | usec_t next_elapse_realtime; | |||
TimerState state, deserialized_state; | TimerState state, deserialized_state; | |||
UnitRef unit; | ||||
Watch monotonic_watch; | Watch monotonic_watch; | |||
Watch realtime_watch; | Watch realtime_watch; | |||
TimerResult result; | TimerResult result; | |||
}; | ||||
void timer_unit_notify(Unit *u, UnitActiveState new_state); | usec_t last_trigger_monotonic; | |||
}; | ||||
void timer_free_values(Timer *t); | void timer_free_values(Timer *t); | |||
extern const UnitVTable timer_vtable; | extern const UnitVTable timer_vtable; | |||
const char *timer_state_to_string(TimerState i); | const char *timer_state_to_string(TimerState i) _const_; | |||
TimerState timer_state_from_string(const char *s); | TimerState timer_state_from_string(const char *s) _pure_; | |||
const char *timer_base_to_string(TimerBase i); | const char *timer_base_to_string(TimerBase i) _const_; | |||
TimerBase timer_base_from_string(const char *s); | TimerBase timer_base_from_string(const char *s) _pure_; | |||
const char* timer_result_to_string(TimerResult i); | const char* timer_result_to_string(TimerResult i) _const_; | |||
TimerResult timer_result_from_string(const char *s); | TimerResult timer_result_from_string(const char *s) _pure_; | |||
End of changes. 6 change blocks. | ||||
7 lines changed or deleted | 6 lines changed or added | |||
udev.h | udev.h | |||
---|---|---|---|---|
skipping to change at line 19 | skipping to change at line 19 | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | * GNU 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 General Public License | |||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
*/ | */ | |||
#ifndef _UDEV_H_ | #pragma once | |||
#define _UDEV_H_ | ||||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <sys/param.h> | #include <sys/param.h> | |||
#include <signal.h> | #include <signal.h> | |||
#include "macro.h" | ||||
#include "libudev.h" | #include "libudev.h" | |||
#include "libudev-private.h" | #include "libudev-private.h" | |||
#include "util.h" | #include "util.h" | |||
#include "label.h" | #include "label.h" | |||
#include "strv.h" | #include "strv.h" | |||
struct udev_event { | struct udev_event { | |||
struct udev *udev; | struct udev *udev; | |||
struct udev_device *dev; | struct udev_device *dev; | |||
struct udev_device *dev_parent; | struct udev_device *dev_parent; | |||
skipping to change at line 198 | skipping to change at line 198 | |||
bool udev_builtin_run_once(enum udev_builtin_cmd cmd); | bool udev_builtin_run_once(enum udev_builtin_cmd cmd); | |||
int udev_builtin_run(struct udev_device *dev, enum udev_builtin_cmd cmd, co nst char *command, bool test); | int udev_builtin_run(struct udev_device *dev, enum udev_builtin_cmd cmd, co nst char *command, bool test); | |||
void udev_builtin_list(struct udev *udev); | void udev_builtin_list(struct udev *udev); | |||
bool udev_builtin_validate(struct udev *udev); | bool udev_builtin_validate(struct udev *udev); | |||
int udev_builtin_add_property(struct udev_device *dev, bool test, const cha r *key, const char *val); | int udev_builtin_add_property(struct udev_device *dev, bool test, const cha r *key, const char *val); | |||
int udev_builtin_hwdb_lookup(struct udev_device *dev, const char *modalias, bool test); | int udev_builtin_hwdb_lookup(struct udev_device *dev, const char *modalias, bool test); | |||
/* udev logging */ | /* udev logging */ | |||
void udev_main_log(struct udev *udev, int priority, | void udev_main_log(struct udev *udev, int priority, | |||
const char *file, int line, const char *fn, | const char *file, int line, const char *fn, | |||
const char *format, va_list args); | const char *format, va_list args) _printf_attr_(6, 0); | |||
/* udevadm commands */ | /* udevadm commands */ | |||
struct udevadm_cmd { | struct udevadm_cmd { | |||
const char *name; | const char *name; | |||
int (*cmd)(struct udev *udev, int argc, char *argv[]); | int (*cmd)(struct udev *udev, int argc, char *argv[]); | |||
const char *help; | const char *help; | |||
int debug; | int debug; | |||
}; | }; | |||
extern const struct udevadm_cmd udevadm_info; | extern const struct udevadm_cmd udevadm_info; | |||
extern const struct udevadm_cmd udevadm_trigger; | extern const struct udevadm_cmd udevadm_trigger; | |||
extern const struct udevadm_cmd udevadm_settle; | extern const struct udevadm_cmd udevadm_settle; | |||
extern const struct udevadm_cmd udevadm_control; | extern const struct udevadm_cmd udevadm_control; | |||
extern const struct udevadm_cmd udevadm_monitor; | extern const struct udevadm_cmd udevadm_monitor; | |||
extern const struct udevadm_cmd udevadm_hwdb; | extern const struct udevadm_cmd udevadm_hwdb; | |||
extern const struct udevadm_cmd udevadm_test; | extern const struct udevadm_cmd udevadm_test; | |||
extern const struct udevadm_cmd udevadm_test_builtin; | extern const struct udevadm_cmd udevadm_test_builtin; | |||
#endif | ||||
End of changes. 4 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
unit-name.h | unit-name.h | |||
---|---|---|---|---|
skipping to change at line 26 | skipping to change at line 26 | |||
WITHOUT ANY WARRANTY; without even the implied warranty of | WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include "macro.h" | ||||
#define UNIT_NAME_MAX 256 | #define UNIT_NAME_MAX 256 | |||
typedef enum UnitType UnitType; | typedef enum UnitType UnitType; | |||
typedef enum UnitLoadState UnitLoadState; | typedef enum UnitLoadState UnitLoadState; | |||
enum UnitType { | enum UnitType { | |||
UNIT_SERVICE = 0, | UNIT_SERVICE = 0, | |||
UNIT_SOCKET, | UNIT_SOCKET, | |||
UNIT_TARGET, | UNIT_TARGET, | |||
UNIT_DEVICE, | UNIT_DEVICE, | |||
skipping to change at line 56 | skipping to change at line 58 | |||
enum UnitLoadState { | enum UnitLoadState { | |||
UNIT_STUB = 0, | UNIT_STUB = 0, | |||
UNIT_LOADED, | UNIT_LOADED, | |||
UNIT_ERROR, | UNIT_ERROR, | |||
UNIT_MERGED, | UNIT_MERGED, | |||
UNIT_MASKED, | UNIT_MASKED, | |||
_UNIT_LOAD_STATE_MAX, | _UNIT_LOAD_STATE_MAX, | |||
_UNIT_LOAD_STATE_INVALID = -1 | _UNIT_LOAD_STATE_INVALID = -1 | |||
}; | }; | |||
const char *unit_type_to_string(UnitType i); | const char *unit_type_to_string(UnitType i) _const_; | |||
UnitType unit_type_from_string(const char *s); | UnitType unit_type_from_string(const char *s) _pure_; | |||
const char *unit_load_state_to_string(UnitLoadState i); | const char *unit_load_state_to_string(UnitLoadState i) _const_; | |||
UnitLoadState unit_load_state_from_string(const char *s); | UnitLoadState unit_load_state_from_string(const char *s) _pure_; | |||
int unit_name_to_instance(const char *n, char **instance); | int unit_name_to_instance(const char *n, char **instance); | |||
char* unit_name_to_prefix(const char *n); | char* unit_name_to_prefix(const char *n); | |||
char* unit_name_to_prefix_and_instance(const char *n); | char* unit_name_to_prefix_and_instance(const char *n); | |||
bool unit_name_is_valid(const char *n, bool template_ok); | bool unit_name_is_valid(const char *n, bool template_ok) _pure_; | |||
bool unit_prefix_is_valid(const char *p); | bool unit_prefix_is_valid(const char *p) _pure_; | |||
bool unit_instance_is_valid(const char *i); | bool unit_instance_is_valid(const char *i) _pure_; | |||
UnitType unit_name_to_type(const char *n); | UnitType unit_name_to_type(const char *n) _pure_; | |||
char *unit_name_change_suffix(const char *n, const char *suffix); | char *unit_name_change_suffix(const char *n, const char *suffix); | |||
char *unit_name_build(const char *prefix, const char *instance, const char *suffix); | char *unit_name_build(const char *prefix, const char *instance, const char *suffix); | |||
char *unit_name_escape(const char *f); | char *unit_name_escape(const char *f); | |||
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_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) _pure_; | |||
bool unit_name_is_instance(const char *n); | bool unit_name_is_instance(const char *n) _pure_; | |||
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); | |||
char *unit_dbus_path_from_name(const char *name); | char *unit_dbus_path_from_name(const char *name); | |||
End of changes. 6 change blocks. | ||||
10 lines changed or deleted | 12 lines changed or added | |||
unit.h | unit.h | |||
---|---|---|---|---|
skipping to change at line 355 | skipping to change at line 355 | |||
/* 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); | |||
/* Called whenever a name thus Unit registered for comes or | /* Called whenever a name this Unit registered for comes or | |||
* goes away. */ | * goes away. */ | |||
void (*bus_name_owner_change)(Unit *u, const char *name, const char *old_owner, const char *new_owner); | void (*bus_name_owner_change)(Unit *u, const char *name, const char *old_owner, const char *new_owner); | |||
/* Called whenever a bus PID lookup finishes */ | /* Called whenever a bus PID lookup finishes */ | |||
void (*bus_query_pid_done)(Unit *u, const char *name, pid_t pid); | void (*bus_query_pid_done)(Unit *u, const char *name, pid_t pid); | |||
/* Called for each message received on the bus */ | /* Called for each message received on the bus */ | |||
DBusHandlerResult (*bus_message_handler)(Unit *u, DBusConnection *c , DBusMessage *message); | DBusHandlerResult (*bus_message_handler)(Unit *u, DBusConnection *c , DBusMessage *message); | |||
/* Return the unit this unit is following */ | /* Return the unit this unit is following */ | |||
Unit *(*following)(Unit *u); | Unit *(*following)(Unit *u); | |||
/* Return the set of units that are following each other */ | /* Return the set of units that are following each other */ | |||
int (*following_set)(Unit *u, Set **s); | int (*following_set)(Unit *u, Set **s); | |||
/* Invoked each time a unit this unit is triggering changes | ||||
* state or gains/loses a job */ | ||||
void (*trigger_notify)(Unit *u, Unit *trigger); | ||||
/* Called whenever CLOCK_REALTIME made a jump */ | /* Called whenever CLOCK_REALTIME made a jump */ | |||
void (*time_change)(Unit *u); | void (*time_change)(Unit *u); | |||
/* This is called for each unit type and should be used to | /* This is called for each unit type and should be used to | |||
* enumerate existing devices and load them. However, | * enumerate existing devices and load them. However, | |||
* everything that is loaded here should still stay in | * everything that is loaded here should still stay in | |||
* inactive state. It is the job of the coldplug() call above | * inactive state. It is the job of the coldplug() call above | |||
* to put the units into the initial state. */ | * to put the units into the initial state. */ | |||
int (*enumerate)(Manager *m); | int (*enumerate)(Manager *m); | |||
skipping to change at line 420 | skipping to change at line 424 | |||
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)) \ | |||
return NULL; \ | return NULL; \ | |||
\ | \ | |||
return (MixedCase*) u; \ | return (MixedCase*) u; \ | |||
} | } | |||
/* For casting the various unit types into a unit */ | /* For casting the various unit types into a unit */ | |||
#define UNIT(u) (&(u)->meta) | #define UNIT(u) (&(u)->meta) | |||
#define UNIT_TRIGGER(u) ((Unit*) set_first((u)->dependencies[UNIT_TRIGGERS] | ||||
)) | ||||
DEFINE_CAST(SOCKET, Socket); | DEFINE_CAST(SOCKET, Socket); | |||
DEFINE_CAST(TIMER, Timer); | DEFINE_CAST(TIMER, Timer); | |||
DEFINE_CAST(SERVICE, Service); | DEFINE_CAST(SERVICE, Service); | |||
DEFINE_CAST(TARGET, Target); | DEFINE_CAST(TARGET, Target); | |||
DEFINE_CAST(DEVICE, Device); | DEFINE_CAST(DEVICE, Device); | |||
DEFINE_CAST(MOUNT, Mount); | DEFINE_CAST(MOUNT, Mount); | |||
DEFINE_CAST(AUTOMOUNT, Automount); | DEFINE_CAST(AUTOMOUNT, Automount); | |||
DEFINE_CAST(SNAPSHOT, Snapshot); | DEFINE_CAST(SNAPSHOT, Snapshot); | |||
DEFINE_CAST(SWAP, Swap); | DEFINE_CAST(SWAP, Swap); | |||
DEFINE_CAST(PATH, Path); | DEFINE_CAST(PATH, Path); | |||
skipping to change at line 447 | skipping to change at line 453 | |||
int unit_add_two_dependencies(Unit *u, UnitDependency d, UnitDependency e, Unit *other, bool add_reference); | int unit_add_two_dependencies(Unit *u, UnitDependency d, UnitDependency e, Unit *other, bool add_reference); | |||
int unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name , const char *filename, bool add_reference); | int unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name , const char *filename, bool add_reference); | |||
int unit_add_two_dependencies_by_name(Unit *u, UnitDependency d, UnitDepend ency e, const char *name, const char *path, bool add_reference); | int unit_add_two_dependencies_by_name(Unit *u, UnitDependency d, UnitDepend ency e, const char *name, const char *path, bool add_reference); | |||
int unit_add_dependency_by_name_inverse(Unit *u, UnitDependency d, const ch ar *name, const char *filename, bool add_reference); | int unit_add_dependency_by_name_inverse(Unit *u, UnitDependency d, const ch ar *name, const char *filename, bool add_reference); | |||
int unit_add_two_dependencies_by_name_inverse(Unit *u, UnitDependency d, Un itDependency e, const char *name, const char *path, bool add_reference); | int unit_add_two_dependencies_by_name_inverse(Unit *u, UnitDependency d, Un itDependency e, const char *name, const char *path, bool add_reference); | |||
int unit_add_exec_dependencies(Unit *u, ExecContext *c); | int unit_add_exec_dependencies(Unit *u, ExecContext *c); | |||
int unit_add_cgroup(Unit *u, CGroupBonding *b); | ||||
int unit_add_cgroup_from_text(Unit *u, const char *name, bool overwrite, CG roupBonding **ret); | int unit_add_cgroup_from_text(Unit *u, const char *name, bool overwrite, CG roupBonding **ret); | |||
int unit_add_default_cgroups(Unit *u); | int unit_add_default_cgroups(Unit *u); | |||
CGroupBonding* unit_get_default_cgroup(Unit *u); | CGroupBonding* unit_get_default_cgroup(Unit *u); | |||
int unit_add_cgroup_attribute(Unit *u, const CGroupSemantics *semantics, co nst char *controller, const char *name, const char *value, CGroupAttribute **ret); | int unit_add_cgroup_attribute(Unit *u, const CGroupSemantics *semantics, co nst char *controller, const char *name, const char *value, CGroupAttribute **ret); | |||
int unit_choose_id(Unit *u, const char *name); | int unit_choose_id(Unit *u, const char *name); | |||
int unit_set_description(Unit *u, const char *description); | int unit_set_description(Unit *u, const char *description); | |||
bool unit_check_gc(Unit *u); | bool unit_check_gc(Unit *u); | |||
void unit_add_to_load_queue(Unit *u); | void unit_add_to_load_queue(Unit *u); | |||
void unit_add_to_dbus_queue(Unit *u); | void unit_add_to_dbus_queue(Unit *u); | |||
void unit_add_to_cleanup_queue(Unit *u); | void unit_add_to_cleanup_queue(Unit *u); | |||
void unit_add_to_gc_queue(Unit *u); | void unit_add_to_gc_queue(Unit *u); | |||
int unit_merge(Unit *u, Unit *other); | int unit_merge(Unit *u, Unit *other); | |||
int unit_merge_by_name(Unit *u, const char *other); | int unit_merge_by_name(Unit *u, const char *other); | |||
Unit *unit_follow_merge(Unit *u); | Unit *unit_follow_merge(Unit *u) _pure_; | |||
int unit_load_fragment_and_dropin(Unit *u); | int unit_load_fragment_and_dropin(Unit *u); | |||
int unit_load_fragment_and_dropin_optional(Unit *u); | int unit_load_fragment_and_dropin_optional(Unit *u); | |||
int unit_load(Unit *unit); | int unit_load(Unit *unit); | |||
const char *unit_description(Unit *u); | const char *unit_description(Unit *u) _pure_; | |||
bool unit_has_name(Unit *u, const char *name); | bool unit_has_name(Unit *u, const char *name); | |||
UnitActiveState unit_active_state(Unit *u); | UnitActiveState unit_active_state(Unit *u); | |||
const char* unit_sub_state_to_string(Unit *u); | const char* unit_sub_state_to_string(Unit *u); | |||
void unit_dump(Unit *u, FILE *f, const char *prefix); | void unit_dump(Unit *u, FILE *f, const char *prefix); | |||
bool unit_can_reload(Unit *u); | bool unit_can_reload(Unit *u) _pure_; | |||
bool unit_can_start(Unit *u); | bool unit_can_start(Unit *u) _pure_; | |||
bool unit_can_isolate(Unit *u); | bool unit_can_isolate(Unit *u) _pure_; | |||
int unit_start(Unit *u); | int unit_start(Unit *u); | |||
int unit_stop(Unit *u); | int unit_stop(Unit *u); | |||
int unit_reload(Unit *u); | int unit_reload(Unit *u); | |||
int unit_kill(Unit *u, KillWho w, int signo, DBusError *error); | int unit_kill(Unit *u, KillWho w, int signo, DBusError *error); | |||
int unit_kill_common(Unit *u, KillWho who, int signo, pid_t main_pid, pid_t control_pid, DBusError *error); | int unit_kill_common(Unit *u, KillWho who, int signo, pid_t main_pid, pid_t control_pid, 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); | |||
skipping to change at line 516 | skipping to change at line 521 | |||
bool unit_job_is_applicable(Unit *u, JobType j); | bool unit_job_is_applicable(Unit *u, JobType j); | |||
int set_unit_path(const char *p); | int set_unit_path(const char *p); | |||
char *unit_dbus_path(Unit *u); | char *unit_dbus_path(Unit *u); | |||
int unit_load_related_unit(Unit *u, const char *type, Unit **_found); | int unit_load_related_unit(Unit *u, const char *type, Unit **_found); | |||
int unit_get_related_unit(Unit *u, const char *type, Unit **_found); | int unit_get_related_unit(Unit *u, const char *type, Unit **_found); | |||
bool unit_can_serialize(Unit *u); | bool unit_can_serialize(Unit *u) _pure_; | |||
int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs); | int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs); | |||
void unit_serialize_item_format(Unit *u, FILE *f, const char *key, const ch ar *value, ...) _printf_attr_(4,5); | void unit_serialize_item_format(Unit *u, FILE *f, const char *key, const ch ar *value, ...) _printf_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 *unit_statu s_msg_format); | void unit_status_printf(Unit *u, const char *status, const char *unit_statu s_msg_format) _printf_attr_(3, 0); | |||
bool unit_need_daemon_reload(Unit *u); | bool unit_need_daemon_reload(Unit *u); | |||
void unit_reset_failed(Unit *u); | void unit_reset_failed(Unit *u); | |||
Unit *unit_following(Unit *u); | Unit *unit_following(Unit *u); | |||
bool unit_pending_inactive(Unit *u); | bool unit_stop_pending(Unit *u) _pure_; | |||
bool unit_pending_active(Unit *u); | bool unit_inactive_or_pending(Unit *u) _pure_; | |||
bool unit_active_or_pending(Unit *u); | ||||
int unit_add_default_target_dependency(Unit *u, Unit *target); | int unit_add_default_target_dependency(Unit *u, Unit *target); | |||
char *unit_default_cgroup_path(Unit *u); | char *unit_default_cgroup_path(Unit *u); | |||
int unit_following_set(Unit *u, Set **s); | int unit_following_set(Unit *u, Set **s); | |||
void unit_trigger_on_failure(Unit *u); | void unit_start_on_failure(Unit *u); | |||
void unit_trigger_notify(Unit *u); | ||||
bool unit_condition_test(Unit *u); | bool unit_condition_test(Unit *u); | |||
UnitFileState unit_get_unit_file_state(Unit *u); | UnitFileState unit_get_unit_file_state(Unit *u); | |||
Unit* unit_ref_set(UnitRef *ref, Unit *u); | Unit* unit_ref_set(UnitRef *ref, Unit *u); | |||
void unit_ref_unset(UnitRef *ref); | void unit_ref_unset(UnitRef *ref); | |||
#define UNIT_DEREF(ref) ((ref).unit) | #define UNIT_DEREF(ref) ((ref).unit) | |||
int unit_add_one_mount_link(Unit *u, Mount *m); | int unit_add_one_mount_link(Unit *u, Mount *m); | |||
int unit_add_mount_links(Unit *u); | int unit_add_mount_links(Unit *u); | |||
int unit_exec_context_defaults(Unit *u, ExecContext *c); | int unit_exec_context_defaults(Unit *u, ExecContext *c); | |||
ExecContext *unit_get_exec_context(Unit *u); | ExecContext *unit_get_exec_context(Unit *u) _pure_; | |||
int unit_write_drop_in(Unit *u, bool runtime, const char *name, const char *data); | int unit_write_drop_in(Unit *u, bool runtime, const char *name, const char *data); | |||
int unit_remove_drop_in(Unit *u, bool runtime, const char *name); | int unit_remove_drop_in(Unit *u, bool runtime, const char *name); | |||
int unit_kill_context(Unit *u, KillContext *c, bool sigkill, pid_t main_pid , pid_t control_pid, bool main_pid_alien); | int unit_kill_context(Unit *u, KillContext *c, bool sigkill, pid_t main_pid , pid_t control_pid, bool main_pid_alien); | |||
const char *unit_active_state_to_string(UnitActiveState i); | const char *unit_active_state_to_string(UnitActiveState i) _const_; | |||
UnitActiveState unit_active_state_from_string(const char *s); | UnitActiveState unit_active_state_from_string(const char *s) _pure_; | |||
const char *unit_dependency_to_string(UnitDependency i); | const char *unit_dependency_to_string(UnitDependency i) _const_; | |||
UnitDependency unit_dependency_from_string(const char *s); | UnitDependency unit_dependency_from_string(const char *s) _pure_; | |||
/* Macros which append UNIT= or USER_UNIT= to the message */ | /* Macros which append UNIT= or USER_UNIT= to the message */ | |||
#define log_full_unit(level, unit, ...) log_meta_object(level, __FILE__, __ LINE__, __func__, getpid() == 1 ? "UNIT=" : "USER_UNIT=", unit, __VA_ARGS__ ) | #define log_full_unit(level, unit, ...) log_meta_object(level, __FILE__, __ LINE__, __func__, getpid() == 1 ? "UNIT=" : "USER_UNIT=", unit, __VA_ARGS__ ) | |||
#define log_debug_unit(unit, ...) log_full_unit(LOG_DEBUG, unit, __VA _ARGS__) | #define log_debug_unit(unit, ...) log_full_unit(LOG_DEBUG, unit, __VA _ARGS__) | |||
#define log_info_unit(unit, ...) log_full_unit(LOG_INFO, unit, __VA_ ARGS__) | #define log_info_unit(unit, ...) log_full_unit(LOG_INFO, unit, __VA_ ARGS__) | |||
#define log_notice_unit(unit, ...) log_full_unit(LOG_NOTICE, unit, __V A_ARGS__) | #define log_notice_unit(unit, ...) log_full_unit(LOG_NOTICE, unit, __V A_ARGS__) | |||
#define log_warning_unit(unit, ...) log_full_unit(LOG_WARNING, unit, __ VA_ARGS__) | #define log_warning_unit(unit, ...) log_full_unit(LOG_WARNING, unit, __ VA_ARGS__) | |||
#define log_error_unit(unit, ...) log_full_unit(LOG_ERR, unit, __VA_A RGS__) | #define log_error_unit(unit, ...) log_full_unit(LOG_ERR, unit, __VA_A RGS__) | |||
End of changes. 14 change blocks. | ||||
17 lines changed or deleted | 25 lines changed or added | |||
util.h | util.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
systemd is distributed in the hope that it will be useful, but | systemd is distributed in the hope that it will be useful, but | |||
WITHOUT ANY WARRANTY; without even the implied warranty of | WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
You should have received a copy of the GNU Lesser General Public License | You should have received a copy of the GNU Lesser General Public License | |||
along with systemd; If not, see <http://www.gnu.org/licenses/>. | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |||
***/ | ***/ | |||
#include <alloca.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | |||
#include <time.h> | #include <time.h> | |||
#include <sys/time.h> | #include <sys/time.h> | |||
#include <stdarg.h> | #include <stdarg.h> | |||
#include <stdbool.h> | #include <stdbool.h> | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#include <signal.h> | #include <signal.h> | |||
#include <sched.h> | #include <sched.h> | |||
#include <limits.h> | #include <limits.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <sys/stat.h> | #include <sys/stat.h> | |||
#include <dirent.h> | #include <dirent.h> | |||
#include <sys/resource.h> | #include <sys/resource.h> | |||
#include <stddef.h> | #include <stddef.h> | |||
#include <unistd.h> | #include <unistd.h> | |||
#include <locale.h> | ||||
#include "macro.h" | #include "macro.h" | |||
#include "time-util.h" | #include "time-util.h" | |||
union dirent_storage { | union dirent_storage { | |||
struct dirent de; | struct dirent de; | |||
uint8_t storage[offsetof(struct dirent, d_name) + | uint8_t storage[offsetof(struct dirent, d_name) + | |||
((NAME_MAX + 1 + sizeof(long)) & ~(sizeof(long) - 1 ))]; | ((NAME_MAX + 1 + sizeof(long)) & ~(sizeof(long) - 1 ))]; | |||
}; | }; | |||
skipping to change at line 75 | skipping to change at line 77 | |||
#define ANSI_ERASE_TO_END_OF_LINE "\x1B[K" | #define ANSI_ERASE_TO_END_OF_LINE "\x1B[K" | |||
size_t page_size(void); | size_t page_size(void); | |||
#define PAGE_ALIGN(l) ALIGN_TO((l), page_size()) | #define PAGE_ALIGN(l) ALIGN_TO((l), page_size()) | |||
#define streq(a,b) (strcmp((a),(b)) == 0) | #define streq(a,b) (strcmp((a),(b)) == 0) | |||
#define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) | #define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) | |||
#define strcaseeq(a,b) (strcasecmp((a),(b)) == 0) | #define strcaseeq(a,b) (strcasecmp((a),(b)) == 0) | |||
#define strncaseeq(a, b, n) (strncasecmp((a), (b), (n)) == 0) | #define strncaseeq(a, b, n) (strncasecmp((a), (b), (n)) == 0) | |||
bool streq_ptr(const char *a, const char *b); | bool streq_ptr(const char *a, const char *b) _pure_; | |||
#define new(t, n) ((t*) malloc_multiply(sizeof(t), (n))) | #define new(t, n) ((t*) malloc_multiply(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 newa(t, n) ((t*) alloca(sizeof(t)*(n))) | |||
#define newdup(t, p, n) ((t*) memdup_multiply(p, sizeof(t), (n))) | #define newdup(t, p, n) ((t*) memdup_multiply(p, sizeof(t), (n))) | |||
#define malloc0(n) (calloc((n), 1)) | #define malloc0(n) (calloc((n), 1)) | |||
skipping to change at line 107 | skipping to change at line 109 | |||
} | } | |||
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 isempty(const char *p) { | static inline bool isempty(const char *p) { | |||
return !p || !p[0]; | return !p || !p[0]; | |||
} | } | |||
char *endswith(const char *s, const char *postfix); | char *endswith(const char *s, const char *postfix) _pure_; | |||
char *startswith(const char *s, const char *prefix); | char *startswith(const char *s, const char *prefix) _pure_; | |||
char *startswith_no_case(const char *s, const char *prefix); | char *startswith_no_case(const char *s, const char *prefix) _pure_; | |||
bool first_word(const char *s, const char *word); | bool first_word(const char *s, const char *word) _pure_; | |||
int close_nointr(int fd); | int close_nointr(int fd); | |||
void close_nointr_nofail(int fd); | 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) _pure_; | |||
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 212 | skipping to change at line 214 | |||
char *file_in_same_dir(const char *path, const char *filename); | char *file_in_same_dir(const char *path, const char *filename); | |||
int rmdir_parents(const char *path, const char *stop); | int rmdir_parents(const char *path, const char *stop); | |||
int get_process_comm(pid_t pid, char **name); | int get_process_comm(pid_t pid, char **name); | |||
int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, c har **line); | int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, c har **line); | |||
int get_process_exe(pid_t pid, char **name); | int get_process_exe(pid_t pid, char **name); | |||
int get_process_uid(pid_t pid, uid_t *uid); | int get_process_uid(pid_t pid, uid_t *uid); | |||
int get_process_gid(pid_t pid, gid_t *gid); | int get_process_gid(pid_t pid, gid_t *gid); | |||
char hexchar(int x); | char hexchar(int x) _const_; | |||
int unhexchar(char c); | int unhexchar(char c) _const_; | |||
char octchar(int x); | char octchar(int x) _const_; | |||
int unoctchar(char c); | int unoctchar(char c) _const_; | |||
char decchar(int x); | char decchar(int x) _const_; | |||
int undecchar(char c); | int undecchar(char c) _const_; | |||
char *cescape(const char *s); | char *cescape(const char *s); | |||
char *cunescape(const char *s); | char *cunescape(const char *s); | |||
char *cunescape_length(const char *s, size_t length); | char *cunescape_length(const char *s, size_t length); | |||
char *cunescape_length_with_prefix(const char *s, size_t length, const char *prefix); | char *cunescape_length_with_prefix(const char *s, size_t length, const char *prefix); | |||
char *xescape(const char *s, const char *bad); | char *xescape(const char *s, const char *bad); | |||
char *bus_path_escape(const char *s); | char *bus_path_escape(const char *s); | |||
char *bus_path_unescape(const char *s); | char *bus_path_unescape(const char *s); | |||
char *ascii_strlower(char *path); | char *ascii_strlower(char *path); | |||
bool dirent_is_file(const struct dirent *de); | bool dirent_is_file(const struct dirent *de) _pure_; | |||
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 | |||
); | ) _pure_; | |||
bool ignore_file(const char *filename); | bool ignore_file(const char *filename) _pure_; | |||
bool chars_intersect(const char *a, const char *b); | bool chars_intersect(const char *a, const char *b) _pure_; | |||
int make_stdio(int fd); | int make_stdio(int fd); | |||
int make_null_stdio(void); | int make_null_stdio(void); | |||
int make_console_stdio(void); | int make_console_stdio(void); | |||
unsigned long long random_ull(void); | unsigned long long random_ull(void); | |||
/* For basic lookup tables with strictly enumerated entries */ | /* For basic lookup tables with strictly enumerated entries */ | |||
#define __DEFINE_STRING_TABLE_LOOKUP(name,type,scope) \ | #define __DEFINE_STRING_TABLE_LOOKUP(name,type,scope) \ | |||
scope const char *name##_to_string(type i) { \ | scope const char *name##_to_string(type i) { \ | |||
skipping to change at line 308 | skipping to change at line 310 | |||
int fd_nonblock(int fd, bool nonblock); | int fd_nonblock(int fd, bool nonblock); | |||
int fd_cloexec(int fd, bool cloexec); | int fd_cloexec(int fd, bool cloexec); | |||
int close_all_fds(const int except[], unsigned n_except); | int close_all_fds(const int except[], unsigned n_except); | |||
bool fstype_is_network(const char *fstype); | bool fstype_is_network(const char *fstype); | |||
int chvt(int vt); | int chvt(int vt); | |||
int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl); | int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl); | |||
int ask(char *ret, const char *replies, const char *text, ...); | int ask(char *ret, const char *replies, const char *text, ...) _printf_attr _(3, 4); | |||
int reset_terminal_fd(int fd, bool switch_to_text); | int reset_terminal_fd(int fd, bool switch_to_text); | |||
int reset_terminal(const char *name); | int reset_terminal(const char *name); | |||
int open_terminal(const char *name, int mode); | int open_terminal(const char *name, int mode); | |||
int acquire_terminal(const char *name, bool fail, bool force, bool ignore_t iocstty_eperm, usec_t timeout); | int acquire_terminal(const char *name, bool fail, bool force, bool ignore_t iocstty_eperm, usec_t timeout); | |||
int release_terminal(void); | int release_terminal(void); | |||
int flush_fd(int fd); | int flush_fd(int fd); | |||
skipping to change at line 362 | skipping to change at line 364 | |||
int rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root_dev); | int rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root_dev); | |||
int rm_rf_children_dangerous(int fd, bool only_dirs, bool honour_sticky, st ruct stat *root_dev); | int rm_rf_children_dangerous(int fd, bool only_dirs, bool honour_sticky, st ruct stat *root_dev); | |||
int rm_rf(const char *path, bool only_dirs, bool delete_root, bool honour_s ticky); | int rm_rf(const char *path, bool only_dirs, bool delete_root, bool honour_s ticky); | |||
int rm_rf_dangerous(const char *path, bool only_dirs, bool delete_root, boo l honour_sticky); | int rm_rf_dangerous(const char *path, bool only_dirs, bool delete_root, boo l honour_sticky); | |||
int pipe_eof(int fd); | int pipe_eof(int fd); | |||
cpu_set_t* cpu_set_malloc(unsigned *ncpus); | cpu_set_t* cpu_set_malloc(unsigned *ncpus); | |||
int status_vprintf(const char *status, bool ellipse, bool ephemeral, const | int status_vprintf(const char *status, bool ellipse, bool ephemeral, const | |||
char *format, va_list ap); | char *format, va_list ap) _printf_attr_(4,0); | |||
int status_printf(const char *status, bool ellipse, bool ephemeral, const c | int status_printf(const char *status, bool ellipse, bool ephemeral, const c | |||
har *format, ...); | har *format, ...) _printf_attr_(4,5); | |||
int status_welcome(void); | int status_welcome(void); | |||
int fd_columns(int fd); | int fd_columns(int fd); | |||
unsigned columns(void); | unsigned columns(void); | |||
int fd_lines(int fd); | int fd_lines(int fd); | |||
unsigned lines(void); | unsigned lines(void); | |||
void columns_lines_cache_reset(int _unused_ signum); | void columns_lines_cache_reset(int _unused_ signum); | |||
bool on_tty(void); | bool on_tty(void); | |||
skipping to change at line 389 | skipping to change at line 391 | |||
int touch(const char *path); | int touch(const char *path); | |||
char *unquote(const char *s, const char *quotes); | char *unquote(const char *s, const char *quotes); | |||
char *normalize_env_assignment(const char *s); | char *normalize_env_assignment(const char *s); | |||
int wait_for_terminate(pid_t pid, siginfo_t *status); | int wait_for_terminate(pid_t pid, siginfo_t *status); | |||
int wait_for_terminate_and_warn(const char *name, pid_t pid); | int wait_for_terminate_and_warn(const char *name, pid_t pid); | |||
_noreturn_ void freeze(void); | _noreturn_ void freeze(void); | |||
bool null_or_empty(struct stat *st); | bool null_or_empty(struct stat *st) _pure_; | |||
int null_or_empty_path(const char *fn); | int null_or_empty_path(const char *fn); | |||
DIR *xopendirat(int dirfd, const char *name, int flags); | DIR *xopendirat(int dirfd, const char *name, int flags); | |||
char *fstab_node_to_udev_node(const char *p); | char *fstab_node_to_udev_node(const char *p); | |||
char *resolve_dev_console(char **active); | char *resolve_dev_console(char **active); | |||
bool tty_is_vc(const char *tty); | bool tty_is_vc(const char *tty); | |||
bool tty_is_vc_resolve(const char *tty); | bool tty_is_vc_resolve(const char *tty); | |||
bool tty_is_console(const char *tty); | bool tty_is_console(const char *tty) _pure_; | |||
int vtnr_from_tty(const char *tty); | int vtnr_from_tty(const char *tty); | |||
const char *default_term_for_tty(const char *tty); | const char *default_term_for_tty(const char *tty); | |||
void execute_directory(const char *directory, DIR *_d, char *argv[]); | void execute_directory(const char *directory, DIR *_d, char *argv[]); | |||
int kill_and_sigcont(pid_t pid, int sig); | int kill_and_sigcont(pid_t pid, int sig); | |||
bool nulstr_contains(const char*nulstr, const char *needle); | bool nulstr_contains(const char*nulstr, const char *needle); | |||
bool plymouth_running(void); | bool plymouth_running(void); | |||
bool hostname_is_valid(const char *s); | bool hostname_is_valid(const char *s) _pure_; | |||
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_atomic(const char *from, const char *to); | int symlink_atomic(const char *from, const char *to); | |||
int fchmod_umask(int fd, mode_t mode); | int fchmod_umask(int fd, mode_t mode); | |||
bool display_is_local(const char *display); | bool display_is_local(const char *display) _pure_; | |||
int socket_from_display(const char *display, char **path); | int socket_from_display(const char *display, char **path); | |||
int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const cha r **home, const char **shell); | int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const cha r **home, const char **shell); | |||
int get_group_creds(const char **groupname, gid_t *gid); | int get_group_creds(const char **groupname, gid_t *gid); | |||
int in_gid(gid_t gid); | int in_gid(gid_t gid); | |||
int in_group(const char *name); | int in_group(const char *name); | |||
char* uid_to_name(uid_t uid); | char* uid_to_name(uid_t uid); | |||
char* gid_to_name(gid_t gid); | char* gid_to_name(gid_t gid); | |||
skipping to change at line 450 | skipping to change at line 452 | |||
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 *strjoin(const char *x, ...) _sentinel_; | char *strjoin(const char *x, ...) _sentinel_; | |||
bool is_main_thread(void); | bool is_main_thread(void); | |||
bool in_charset(const char *s, const char* charset); | bool in_charset(const char *s, const char* charset) _pure_; | |||
int block_get_whole_disk(dev_t d, dev_t *ret); | int block_get_whole_disk(dev_t d, dev_t *ret); | |||
int file_is_priv_sticky(const char *p); | int file_is_priv_sticky(const char *p); | |||
int strdup_or_null(const char *a, char **b); | int strdup_or_null(const char *a, char **b); | |||
#define NULSTR_FOREACH(i, l) \ | #define NULSTR_FOREACH(i, l) \ | |||
for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1) | for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1) | |||
#define NULSTR_FOREACH_PAIR(i, j, l) \ | #define NULSTR_FOREACH_PAIR(i, j, l) \ | |||
for ((i) = (l), (j) = strchr((i), 0)+1; (i) && *(i); (i) = strchr(( j), 0)+1, (j) = *(i) ? strchr((i), 0)+1 : (i)) | for ((i) = (l), (j) = strchr((i), 0)+1; (i) && *(i); (i) = strchr(( j), 0)+1, (j) = *(i) ? strchr((i), 0)+1 : (i)) | |||
int ioprio_class_to_string_alloc(int i, char **s); | int ioprio_class_to_string_alloc(int i, char **s); | |||
int ioprio_class_from_string(const char *s); | int ioprio_class_from_string(const char *s); | |||
const char *sigchld_code_to_string(int i); | const char *sigchld_code_to_string(int i) _const_; | |||
int sigchld_code_from_string(const char *s); | int sigchld_code_from_string(const char *s) _pure_; | |||
int log_facility_unshifted_to_string_alloc(int i, char **s); | int log_facility_unshifted_to_string_alloc(int i, char **s); | |||
int log_facility_unshifted_from_string(const char *s); | int log_facility_unshifted_from_string(const char *s); | |||
int log_level_to_string_alloc(int i, char **s); | int log_level_to_string_alloc(int i, char **s); | |||
int log_level_from_string(const char *s); | int log_level_from_string(const char *s); | |||
int sched_policy_to_string_alloc(int i, char **s); | int sched_policy_to_string_alloc(int i, char **s); | |||
int sched_policy_from_string(const char *s); | int sched_policy_from_string(const char *s); | |||
const char *rlimit_to_string(int i); | const char *rlimit_to_string(int i) _const_; | |||
int rlimit_from_string(const char *s); | int rlimit_from_string(const char *s) _pure_; | |||
int ip_tos_to_string_alloc(int i, char **s); | int ip_tos_to_string_alloc(int i, char **s); | |||
int ip_tos_from_string(const char *s); | int ip_tos_from_string(const char *s); | |||
const char *signal_to_string(int i); | const char *signal_to_string(int i) _const_; | |||
int signal_from_string(const char *s); | int signal_from_string(const char *s) _pure_; | |||
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) _const_; | |||
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) _malloc_; | void* memdup(const void *p, size_t l) _alloc_(2); | |||
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); | |||
int fork_agent(pid_t *pid, const int except[], unsigned n_except, const cha r *path, ...); | 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 setrlimit_closest(int resource, const struct rlimit *rlim); | |||
int getenv_for_pid(pid_t pid, const char *field, char **_value); | 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) _pure_; | |||
int can_sleep_disk(const char *type); | ||||
bool is_valid_documentation_url(const char *url); | ||||
bool in_initrd(void); | bool in_initrd(void); | |||
void warn_melody(void); | void warn_melody(void); | |||
int get_home_dir(char **ret); | int get_home_dir(char **ret); | |||
static inline void freep(void *p) { | static inline void freep(void *p) { | |||
free(*(void**) p); | free(*(void**) p); | |||
} | } | |||
skipping to change at line 561 | skipping to change at line 560 | |||
} | } | |||
#define _cleanup_free_ _cleanup_(freep) | #define _cleanup_free_ _cleanup_(freep) | |||
#define _cleanup_fclose_ _cleanup_(fclosep) | #define _cleanup_fclose_ _cleanup_(fclosep) | |||
#define _cleanup_pclose_ _cleanup_(pclosep) | #define _cleanup_pclose_ _cleanup_(pclosep) | |||
#define _cleanup_close_ _cleanup_(closep) | #define _cleanup_close_ _cleanup_(closep) | |||
#define _cleanup_closedir_ _cleanup_(closedirp) | #define _cleanup_closedir_ _cleanup_(closedirp) | |||
#define _cleanup_umask_ _cleanup_(umaskp) | #define _cleanup_umask_ _cleanup_(umaskp) | |||
#define _cleanup_globfree_ _cleanup_(globfree) | #define _cleanup_globfree_ _cleanup_(globfree) | |||
_malloc_ static inline void *malloc_multiply(size_t a, size_t b) { | _malloc_ _alloc_(1, 2) static inline void *malloc_multiply(size_t a, size_ t b) { | |||
if (_unlikely_(b == 0 || a > ((size_t) -1) / b)) | if (_unlikely_(b == 0 || a > ((size_t) -1) / b)) | |||
return NULL; | return NULL; | |||
return malloc(a * b); | return malloc(a * b); | |||
} | } | |||
_malloc_ static inline void *memdup_multiply(const void *p, size_t a, size_ t b) { | _alloc_(2, 3) static inline void *memdup_multiply(const void *p, size_t a, size_t b) { | |||
if (_unlikely_(b == 0 || a > ((size_t) -1) / b)) | if (_unlikely_(b == 0 || a > ((size_t) -1) / b)) | |||
return NULL; | return NULL; | |||
return memdup(p, a * b); | return memdup(p, a * b); | |||
} | } | |||
bool filename_is_safe(const char *p); | bool filename_is_safe(const char *p) _pure_; | |||
bool path_is_safe(const char *p); | bool path_is_safe(const char *p) _pure_; | |||
bool string_is_safe(const char *p); | bool string_is_safe(const char *p) _pure_; | |||
bool string_has_cc(const char *p); | bool string_has_cc(const char *p) _pure_; | |||
void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t si ze, | void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t si ze, | |||
int (*compar) (const void *, const void *, void *), | int (*compar) (const void *, const void *, void *), | |||
void *arg); | void *arg); | |||
bool is_locale_utf8(void); | bool is_locale_utf8(void); | |||
typedef enum DrawSpecialChar { | typedef enum DrawSpecialChar { | |||
DRAW_TREE_VERT, | DRAW_TREE_VERT, | |||
DRAW_TREE_BRANCH, | DRAW_TREE_BRANCH, | |||
skipping to change at line 634 | skipping to change at line 633 | |||
else | else | |||
static inline void *mempset(void *s, int c, size_t n) { | static inline void *mempset(void *s, int c, size_t n) { | |||
memset(s, c, n); | memset(s, c, n); | |||
return (uint8_t*)s + n; | return (uint8_t*)s + n; | |||
} | } | |||
char *hexmem(const void *p, size_t l); | char *hexmem(const void *p, size_t l); | |||
void *unhexmem(const char *p, size_t l); | void *unhexmem(const char *p, size_t l); | |||
char *strextend(char **x, ...); | char *strextend(char **x, ...) _sentinel_; | |||
char *strrep(const char *s, unsigned n); | char *strrep(const char *s, unsigned n); | |||
void* greedy_realloc(void **p, size_t *allocated, size_t need); | void* greedy_realloc(void **p, size_t *allocated, size_t need); | |||
#define GREEDY_REALLOC(array, allocated, need) \ | #define GREEDY_REALLOC(array, allocated, need) \ | |||
greedy_realloc((void**) &(array), &(allocated), sizeof((array)[0]) * (need)) | greedy_realloc((void**) &(array), &(allocated), sizeof((array)[0]) * (need)) | |||
static inline void _reset_errno_(int *saved_errno) { | static inline void _reset_errno_(int *saved_errno) { | |||
errno = *saved_errno; | errno = *saved_errno; | |||
} | } | |||
#define PROTECT_ERRNO __attribute__((cleanup(_reset_errno_))) int _saved_er rno_ = errno | #define PROTECT_ERRNO _cleanup_(_reset_errno_) __attribute__((unused)) int _saved_errno_ = errno | |||
struct umask_struct { | struct _umask_struct_ { | |||
mode_t mask; | mode_t mask; | |||
bool quit; | bool quit; | |||
}; | }; | |||
static inline void _reset_umask_(struct umask_struct *s) { | static inline void _reset_umask_(struct _umask_struct_ *s) { | |||
umask(s->mask); | umask(s->mask); | |||
}; | }; | |||
#define RUN_WITH_UMASK(mask) \ | #define RUN_WITH_UMASK(mask) \ | |||
for (__attribute__((cleanup(_reset_umask_))) struct umask_struct _s aved_umask_ = { umask(mask), false }; \ | for (_cleanup_(_reset_umask_) struct _umask_struct_ _saved_umask_ = { umask(mask), false }; \ | |||
!_saved_umask_.quit ; \ | !_saved_umask_.quit ; \ | |||
_saved_umask_.quit = true) | _saved_umask_.quit = true) | |||
static inline unsigned u64log2(uint64_t n) { | static inline unsigned u64log2(uint64_t n) { | |||
return (n > 1) ? __builtin_clzll(n) ^ 63U : 0; | return (n > 1) ? __builtin_clzll(n) ^ 63U : 0; | |||
} | } | |||
static inline bool logind_running(void) { | static inline bool logind_running(void) { | |||
return access("/run/systemd/seats/", F_OK) >= 0; | return access("/run/systemd/seats/", F_OK) >= 0; | |||
} | } | |||
skipping to change at line 699 | skipping to change at line 698 | |||
({ \ | ({ \ | |||
const char *_a_ = (a), *_b_ = (b); \ | const char *_a_ = (a), *_b_ = (b); \ | |||
char *_c_; \ | char *_c_; \ | |||
size_t _x_, _y_; \ | size_t _x_, _y_; \ | |||
_x_ = strlen(_a_); \ | _x_ = strlen(_a_); \ | |||
_y_ = strlen(_b_); \ | _y_ = strlen(_b_); \ | |||
_c_ = alloca(_x_ + _y_ + 1); \ | _c_ = alloca(_x_ + _y_ + 1); \ | |||
strcpy(stpcpy(_c_, _a_), _b_); \ | strcpy(stpcpy(_c_, _a_), _b_); \ | |||
_c_; \ | _c_; \ | |||
}) | }) | |||
#define procfs_file_alloca(pid, field) \ | ||||
({ \ | ||||
pid_t _pid_ = (pid); \ | ||||
char *_r_; \ | ||||
_r_ = alloca(sizeof("/proc/") -1 + DECIMAL_STR_MAX(pid_t) + | ||||
1 + sizeof(field)); \ | ||||
sprintf(_r_, "/proc/%lu/" field, (unsigned long) _pid_); \ | ||||
_r_; \ | ||||
}) | ||||
struct _locale_struct_ { | ||||
locale_t saved_locale; | ||||
locale_t new_locale; | ||||
bool quit; | ||||
}; | ||||
static inline void _reset_locale_(struct _locale_struct_ *s) { | ||||
PROTECT_ERRNO; | ||||
if (s->saved_locale != (locale_t) 0) | ||||
uselocale(s->saved_locale); | ||||
if (s->new_locale != (locale_t) 0) | ||||
freelocale(s->new_locale); | ||||
} | ||||
#define RUN_WITH_LOCALE(mask, loc) \ | ||||
for (_cleanup_(_reset_locale_) struct _locale_struct_ _saved_locale | ||||
_ = { (locale_t) 0, (locale_t) 0, false }; \ | ||||
({ \ | ||||
if (!_saved_locale_.quit) { \ | ||||
PROTECT_ERRNO; \ | ||||
_saved_locale_.new_locale = newlocale((mask), | ||||
(loc), (locale_t) 0); \ | ||||
if (_saved_locale_.new_locale != (locale_t) 0) | ||||
\ | ||||
_saved_locale_.saved_locale = uselocal | ||||
e(_saved_locale_.new_locale); \ | ||||
} \ | ||||
!_saved_locale_.quit; }) ; \ | ||||
_saved_locale_.quit = true) | ||||
bool id128_is_valid(const char *s) _pure_; | ||||
End of changes. 32 change blocks. | ||||
50 lines changed or deleted | 49 lines changed or added | |||