IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
If we pass a constant value to ALIGN() gcc should have the chance to
calculate the value during compilation rather than runtime, so let's
avoid a static inline call if we can.
It is faster to use a bash built-in, then to invoke an external
program. The problem of unit names starting with a dash is solved
by prepending a space. Spaces are ignored anyway.
For zsh, replace echo "$unit", which is vulnerable to dashes,
with echo " $unit".
I was debugging systemd waiting on a missing disk, and noticed
that the job listing could use some polishing. Jobs that are
actually running are highlighted, so it's easier to see what
very actually waiting for.
Also, the needed widths are precalculated, to use available columns
more ecomically.
If the user wants the fd to stay valid he should keep a reference to the
message object or duplicate the fd.
This unifies behaviour of demarshalling data fields and unix fds.
There were old session state files accumulating in /run/systemd/session.
They confused e.g. "reboot", which thought there were still users logged
in. The files got created like this:
session_stop(Session *s) ->
...
unlink(s->state_file);
...
seat_set_active(s->seat, NULL) ->
session_save(...); /* re-creates the state file we just
unlinked */
Fix it simply by clearing the s->started flag earlier to prevent
any further writes of the state file (session_save() checks the flag).
As it turns out if you pass a va_list to a function its state becomes
undefined after that function returns, and this actually does break on
x86-32.
Hence, let's reimplement message_read_ap() without the use of recursion.
Instead we now build our own stack of types in an array so that we can
decode the entire parameter list in a single stackframe.
Make "systemd-analyze dot" output only lines with units matching
given glob(7) patterns. Add --from-pattern and --to-pattern options.
Without any patterns all relationships are printed as before.
A relationship must match the follwing expression:
(isempty(from) || from[0] || from[1] || .. || from[n]) &&
(isempty(to) || to[0] || to[1] || .. || to[n]) &&
(isempty(P) || P[0] || P[1] || ... || P[n])
where from[] and to[] are lists of patterns provided with subsequent
--from-pattern and --to-pattern respectively. P[] is a list of additional
patterns provided after the "dot" subcommand.
Avoid "sender uid=65534, message ignored" case, where no credentials can
be read on the sender side.
Seems, the server socket does not enable credential receiving fast
enough, and the message from the client (without credential) sometimes
is queued before the credential passing was active.
Avoid the dynamic allocation for the _UID, _GID, and _PID strings.
The maximum size of the string can be determined at compile time.
The code has only been compile tested.
When systemd was compiled without audit support, do not collect the
audit session and loginuid in the journal. This is saving a couple of
syscalls and memory allocations per log message.
Avoid memory allocations to construct the path for files in the
procfs. The procfs paths are way shorter than the PATH_MAX so we
can use snprintf on a string located on the stack. This shows up
as a win on x86 using the benchmark program below.
$ make libsystemd-shared.la; gcc -O2 -Isrc/systemd/ -Isrc/ \
-o simple-perf-test simple-perf-test.c \
.libs/libsystemd-shared.a -lrt
#include "shared/util.h"
void test_once(void) {
pid_t pid = getpid();
char *tmp = NULL;
get_process_comm(pid, &tmp);
free(tmp);
tmp = NULL;
get_process_cmdline(pid, 0, 1, &tmp);
free(tmp);
is_kernel_thread(pid);
tmp = NULL;
get_process_exe(pid, &tmp);
free(tmp);
}
int main(int argc, char **argv)
{
int i;
for (i = 0; i < 50000; ++i)
test_once();
}