Lennart Poettering
934ae16baf
proc-cmdline: return proper errors from shall_restore_state()
...
Let's not eat up errors in shall_restore_state(), but in the consumers
instead, just for the sake of keeping the library calls generic.
2015-11-02 23:44:05 +01:00
Lennart Poettering
19854865a8
core: bump net.unix.max_dgram_qlen really early during boot
...
Only that way it actually has an effect on all our sockets, including
$NOTIFY_SOCKET.
2015-11-02 23:44:05 +01:00
Lennart Poettering
9fe4ea21be
string-util: rework memory_erase() so that it cannot be optimized away
...
memory_erase() so far just called memset(), which the compiler might
optimize away under certain conditions if it feels there's benefit in
it. C11 knows a new memset_s() call that is like memset(), but may not
be optimized away. Ideally, we'd just use that call, but glibc currently
does not support it. Hence, implement our own simplistic version of it.
We use a GCC pragma to turn off optimization for this call, and also use
the "volatile" keyword on the pointers to ensure that gcc will use the
pointers as-is. According to a variety of internet sources, either one
does the trick. However, there are also reports that at least the
volatile thing isn't fully correct, hence let's add some snake oil and
employ both techniques.
https://news.ycombinator.com/item?id=4711346
2015-11-02 23:07:20 +01:00
Lennart Poettering
dcd1262673
Revert "utf8.[ch]: use char32_t and char16_t instead of int, int32_t, int16_t"
2015-11-02 11:21:25 +01:00
Daniel Mack
86b4428a58
Merge pull request #1740 from shawnl/master
...
utf8.[ch]: use char32_t and char16_t instead of int, int32_t, int16_t
2015-11-02 10:57:38 +01:00
Shawn Landden
025b4c4105
utf8.[ch]: use char32_t and char16_t instead of int, int32_t, int16_t
...
rework C11 utf8.[ch] to use char32_t instead of uint32_t when referring
to unicode chars, to make things more expressive.
2015-10-31 21:00:57 -07:00
Lennart Poettering
96d66d89c9
core: constify a few things
2015-10-31 19:09:20 +01:00
Lennart Poettering
b41b9d2ae9
systemctl: add a way to explicitly request client-side unit installing
...
This adds support for a new environment variable
SYSTEMCTL_INSTALL_CLIENT_SIDE, that ensures that systemctl executes
install operations client-side instead of passing them to PID1. This is
useful in debugging situations, but even beyond that. However, we don't
want to make it official API, hence let's just make it an undocumented
environment variable.
Similar, add a second variable, SYSTEMCTL_SKIP_SYSV which allows
skipping the SysV chkconfig fall-back if set. This is useful for similar
reasons, and exposed as undocumented as environment variable for similar
reasons, too.
2015-10-31 19:09:20 +01:00
Filipe Brandenburger
a26662ce9b
cpu-set-util: Support ranges in parse_cpu_set_and_warn
...
Tested CPUAffinity ranges on both a service unit and in system.conf and
confirmed they work as expected (by inspecting /proc/PID/status, for the
main pid of the service and for pid 1). Also mixed ranges with both
spaces, commas, trailing commas and spaces.
Added new tests to increase coverage of ranges and prevent regressions.
2015-10-27 17:56:26 -07:00
Filipe Brandenburger
28cb17ef02
parse-util: Introduce new parse_range function
...
This function will be useful for CPUAffinity settings that involve
ranges of CPUs.
Make it generic and include test coverage to prevent regressions.
2015-10-27 17:56:26 -07:00
Filipe Brandenburger
4fc66acb93
cpu-set-util: Accept commas as separators in parse_cpu_set_and_warn
...
Tested CPUAffinity settings on both a service unit and in system.conf
and confirmed they work as expected.
Added a new test to confirm that trailing commas and spaces work and to
prevent any regressions in that area.
2015-10-27 17:39:58 -07:00
Lennart Poettering
7760171904
util-lib: move inotify-related definitions to fs-util.[ch]
2015-10-27 14:58:05 +01:00
Lennart Poettering
4fee397531
util-lib: move fdname_is_valid() to fd-util.[ch]
2015-10-27 14:57:44 +01:00
Lennart Poettering
3f2c0becc3
automount: move generically userful call repeat_mount() into mount-util.[ch]
2015-10-27 14:25:58 +01:00
Lennart Poettering
7b3e062cb6
process-util: move a couple of process-related calls over
2015-10-27 14:24:58 +01:00
Lennart Poettering
5fd9b2c546
process-util: make some minor corrections to PID live detection
2015-10-27 14:02:45 +01:00
Lennart Poettering
6bc73acb01
process-util: rename get_parent_of_pid() → get_process_ppid()
...
In order to match the other get_process_xyz() calls.
2015-10-27 14:01:48 +01:00
Lennart Poettering
405f8907b9
process-util: actually move rename_process() over
...
The prototype was moved long ago, actually move the definition over now,
too.
2015-10-27 13:56:40 +01:00
Lennart Poettering
4e036b7a96
mount-util: move fstype_is_network() and name_to_handle_at() definitions over
2015-10-27 13:45:53 +01:00
Lennart Poettering
b5efdb8af4
util-lib: split out allocation calls into alloc-util.[ch]
2015-10-27 13:45:53 +01:00
Lennart Poettering
7d50b32a12
util-lib: split out globbing related calls into glob-util.[ch]
2015-10-27 13:25:58 +01:00
Lennart Poettering
872a590ef8
stat-util.h: move F_TYPE_EQUAL() macro definition to stat-util.h
2015-10-27 13:25:58 +01:00
Lennart Poettering
15a5e95075
util-lib: split out printf() helpers to stdio-util.h
2015-10-27 13:25:57 +01:00
Lennart Poettering
c7f1808add
macro.h: move definition of MODE_INVALID to parse-util.h
2015-10-27 13:25:57 +01:00
Lennart Poettering
0d1dbeb3a4
macro: move DECIMAL_STR_WIDTH() into macro.h
...
So that it sets next to DECIMAL_STR_MAX(), where it belongs.
2015-10-27 13:25:57 +01:00
Lennart Poettering
8f328d36c9
socket-util: move CMSG_FOREACH() from macro.h to socket-util.h
2015-10-27 13:25:57 +01:00
Lennart Poettering
afc5dbf37f
io-util.h: move iovec stuff from macro.h to io-util.h
2015-10-27 13:25:57 +01:00
Lennart Poettering
ceee6d3a44
process-util: move PID related macros from macro.h to process-util.h
2015-10-27 13:25:57 +01:00
Lennart Poettering
ee104e11e3
user-util: move UID/GID related macros from macro.h to user-util.h
2015-10-27 13:25:57 +01:00
Lennart Poettering
49cf4170d0
util-lib: move web-related calls into web-util.[ch]
2015-10-27 13:25:57 +01:00
Lennart Poettering
7ccbd1ae84
util-lib: split out syslog-related calls into syslog-util.[ch]
2015-10-27 13:25:57 +01:00
Lennart Poettering
7f4b3c5ea3
util-lib: move running_in_chroot() into virt.[ch]
...
It's a very weak kind of virtualization, after all.
2015-10-27 13:25:57 +01:00
Lennart Poettering
4e731273ed
util-lib: move /proc/cmdline parsing code to proc-cmdline.[ch]
2015-10-27 13:25:57 +01:00
Lennart Poettering
d4510856a0
util-lib: move is_main_thread() to process-util.[ch]
2015-10-27 13:25:57 +01:00
Lennart Poettering
430f0182b7
src/basic: rename audit.[ch] → audit-util.[ch] and capability.[ch] → capability-util.[ch]
...
The files are named too generically, so that they might conflict with
the upstream project headers. Hence, let's add a "-util" suffix, to
clarify that this are just our utility headers and not any official
upstream headers.
2015-10-27 13:25:57 +01:00
Lennart Poettering
affb60b1ef
util-lib: split out umask-related code to umask-util.h
2015-10-27 13:25:56 +01:00
Lennart Poettering
8752c5752f
util-lib: move more locale-related calls to locale-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
b8faf2ecd5
util-lib: move status printing stuff into src/core/
...
It's very specific to the core, and not used elsewhere, hence move it
out of terminal-util.[ch].
2015-10-27 13:25:56 +01:00
Lennart Poettering
8b43440b7e
util-lib: move string table stuff into its own string-table.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
8fcde01280
util-lib: split stat()/statfs()/stavfs() related calls into stat-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
f3e2e81d53
util: move string_is_safe() to string-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
f4f15635ec
util-lib: move a number of fs operations into fs-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
c8b3094de5
util-lib: split out file attribute calls to chattr-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
89a5a90cb0
util-lib: split xattr-related calls into xattr-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
a09561746f
util-lib: introduce dirent-util.[ch] for directory entry calls
...
Also, move a couple of more path-related functions to path-util.c.
2015-10-27 13:25:56 +01:00
Lennart Poettering
78f22b973f
util-lib: split out resource limits related calls into rlimit-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
e929bee09a
util-lib: move take_password_lock() to user-util.[ch]
...
Also, rename it take_etc_passwd_lock(), in order to make it more
expressive.
2015-10-27 13:25:55 +01:00
Lennart Poettering
bb15fafe9c
util: move filename_is_valid() and path_is_safe() to path-util.[ch]
2015-10-27 13:25:55 +01:00
Lennart Poettering
4349cd7c1d
util-lib: move mount related utility calls to mount-util.[ch]
2015-10-27 13:25:55 +01:00
Lennart Poettering
6550203eb4
util-lib: move fstab_node_to_udev_node() to fstab-util.[ch]
2015-10-27 13:25:55 +01:00