Age | Commit message (Collapse) | Author |
|
|
|
zero-copy network IO
This also drops --ignore-env, which can't really work anymore if we
allow multiple fds. Also adds support for pretty printing of peer
identities for debug purposes, and abstract namespace UNIX sockets. Also
ensures that we never take more connections than a certain limit.
|
|
Among other things this makes sure we set SO_REUSEADDR which is
immensely useful.
|
|
|
|
Instead of individually checking for containers in each user do this
once in a new call proc_cmdline() that read the file only if we are not
in a container.
|
|
|
|
Should fix linking with old toolchain.
|
|
Move this to src/share/net-util.c, so it can be used elsewhere.
|
|
detect_container()
After all, we ended up calling detect_container() more often than
detect_virtualization(), hence the former one should cache the results,
since the latter is only a wrapper around the former.
|
|
This allow querying the RTC time from the unprivileged timedatectl.
|
|
|
|
|
|
the heap
|
|
|
|
arrays nicely on the fly
|
|
array from stdarg function parameters
This allows us to turn lists of strings passed in easily into string
arrays without having to allocate memory.
|
|
There is no point in keeping one timestamp for each directory, as we only
ever care about the most recent one.
|
|
|
|
Parses a whitespace separated list of strings into a vector of enums.
|
|
This introduces a new key NamePolicy, which takes an ordered list of naming
policies. The first successful one is applide. If all fail the value of Name
(if any) is used.
The possible policies are 'onboard', 'slot', 'path' and 'mac'.
This patch introduces a default link file, which replaces the equivalent udev
rule.
|
|
|
|
The indentation was wrong, also put the semicolon on a separate line to make it clear it is a for-loop
with an epmyt body.
|
|
I want to use this from a bulitin in a subsequent patch.
|
|
Otherwise, the user would have to manually initialize the pointer. Nobody currently uses this code,
so the change in behaviour sohuld be fine.
|
|
|
|
|
|
$ touch src/core/dbus.c; make CFLAGS=-O0
make --no-print-directory all-recursive
Making all in .
CC src/core/libsystemd_core_la-dbus.lo
CCLD libsystemd-core.la
$ touch src/core/dbus.c; make CFLAGS=-Og
make --no-print-directory all-recursive
Making all in .
CC src/core/libsystemd_core_la-dbus.lo
src/core/dbus.c: In function 'init_registered_system_bus':
src/core/dbus.c:798:18: warning: 'id' may be used uninitialized in this function [-Wmaybe-uninitialized]
dbus_free(id);
^
CCLD libsystemd-core.la
-Og Optimize debugging experience. -Og enables optimizations that do
not interfere with debugging. It should be the optimization level of
choice for the standard edit-compile-debug cycle, offering a
reasonable level of optimization while maintaining fast compilation
and a good debugging experience.
|
|
|
|
|
|
maximum
Messages with log levels above the current maximum log level will be dropped
inside log_meta(). But to be able to call the function, all parameters for
the function need to be provided. This can easily get expensive, if values
need to be calculated or functions are used in parameters.
Avoid all useless work by checking inside the macro, before we look
at any parameters passed to the logging functions.
|
|
When set to 0 this will stop tools like the backlight and rfkill tools to
restore state from previous boot. This is useful in case the stored state
is bogus to the extent that it is preventing you from resetting it (e.g.,
the backlight settings cause the screen to be off on boot on a system where
the backlight can not be adjusted directly from the keyboard).
|
|
This way, timedatectl can be run over the network and determine all
properties correctly from the server rather than the client.
|
|
Always use our own macros, and name all our own macros the same style.
|
|
This function should get the same treatment as other qsort uses
did in 7ff7394 "Never call qsort on potentially NULL arrays".
Reported-by: Oleksii Shevchuk <alxchk@gmail.com>
|
|
glob_extend() would completely fail to work, or return incorrect
data if it wasn't being passed the current getopt "optarg" variable
as it used the global variable, instead of the passed parameters.
|
|
each invocation
We can determine the list entry type via the typeof() gcc construct, and
so we should to make the macros much shorter to use.
|
|
Emacs C indenting really gets confused by these lines if they carry no
trailing semicolon, hence let's make this nicer for good old emacs. The
other macros which define functions already do this too, so let's copy
the scheme here.
Also, let's use an uppercase name for the macro. So far our rough rule
was that macros that are totally not function-like (like this ones,
which define a function) are uppercase. (Well, admittedly it is a rough
rule only, for example function and variable decorators are all
lower-case SINCE THE CONSTANT YELLING IN THE SOURCES WOULD SUCK, and
also they at least got underscore prefixes.) Also, the macros that
define functions that we already have are all uppercase, so let's do the
same here...
|
|
|
|
|
|
src/shared/dbus-common.c:968:33: warning: Potential leak of memory pointed to by 'l'
return -EINVAL;
^~~~~~
|
|
Fixes minor leak in error path in device.c.
|
|
This extends 62678ded 'efi: never call qsort on potentially
NULL arrays' to all other places where qsort is used and it
is not obvious that the count is non-zero.
|
|
UNICODE standards only talk about fullwidth characters for East
Asian scripts. But it seems that all those symbols are fullwidth
too.
|
|
rename old versions to ascii_*
Do not take into account zerowidth characters, but do consider double-wide characters.
Import needed utf8 helper code from glib.
v3: rebase ontop of utf8 restructuring work
[zj: tweak the algorithm a bit, move new code to separate file]
|
|
|
|
For the library functions we expose we currently repeatedly use checks
like the following:
if (!value_is_ok(parameter1))
return -EINVAL;
if (!value_is_ok(parameter2))
return -EINVAL;
And so on. Let's turn this into a macro:
assert_return(value_is_ok(parameter1), -EINVAL);
assert_return(value_is_ok(paramater2), -EINVAL);
This makes our code a bit shorter and simpler, and also allows us to add
a _unlikely_() around the check.
|
|
In order to improve energy consumption we should minimize our wake-ups
when handling timers. Hence, for each timer take an accuracy value and
schedule the actual wake-up time somewhere between the specified time
and the specified timer plus the accuracy.
The specified time of timer event sources hence becomes the time the
handler is called the *earliest*, and the specified time plus the accuracy
the time by which it is called the *latest*, leaving the library the
freedom to schedule the wake-up somewhere inbetween.
If the accuracy is specified as 0 the default of 250ms will be used.
When scheduling timeouts we will now try to elapse them at the same
point within each second, across the entire system. We do this by using
a fixed perturbation value keyed off the boot id. If this point within a
second is not in the acceptable range, we try again with a fixed time
within each 250ms time step. If that doesn't work either, we wake up at
the last possible time.
|
|
|
|
Always cache the results, and bypass low-level security calls when the
respective subsystem is not enabled.
|
|
So far we tried to use epoll directly wherever we needed an event loop.
However, that has various shortcomings, such as the inability to handle
larger amounts of timers (since each timerfd costs one fd, which is a
very limited resource, usually bounded to 1024), and inability to do
priorisation between multiple queued events.
Let's add a minimal event loop API around epoll that is suitable for
implementation of our own daemons and maybe one day can become public
API for those who desire it.
This loop is part of libsystemd-bus, but may be used independently of
it.
|