Commit Graph
11 Commits
Author SHA1 Message Date
Daan De Meyer f102bc3e5f tree-wide: Introduce sd-forward.h and shared-forward.h headers
Let's not leak details from src/shared and src/libsystemd into
src/basic, even though you can't actually do anything useful with
just forward declarations from src/shared.

The sd-forward.h header is put in src/libsystemd/sd-common as we
don't have a directory for shared internal headers for libsystemd
yet.

Let's also rename forward.h to basic-forward.h to keep things
self-explanatory.
2025-10-16 17:00:29 +02:00
Daan De Meyer 0c15577abe basic + fundamental: Clean up includes
Split out of #37344.
2025-05-25 10:06:07 +02:00
Daan De Meyer 40d60725ec basic: Move ratelimit logging functions to ratelimit.h
The ratelimit logging functions are only useful in a few scenarios
so let's move them to ratelimit.h instead of keeping them in the
generic log.h
2025-04-18 10:11:40 +02:00
A. Wilcox d0e11b9e17 basic: Include <sys/file.h> for LOCK_* constants
This is needed to ensure LOCK_{EX,SH} are defined in certain
environments, including uclibc-ng and musl libc.
2024-09-06 08:37:25 +09:00
Lennart Poettering cb1b813f0d lock-util: make global lock return parameter to image_path_lock() optional
When adding unprivileged nspawn support we don't really want a global
lock file, since we cannot even access the dir they are stored in, hence
make the concept optional.

Some minor other modernizations.
2024-04-06 16:08:23 +02:00
Lennart Poettering e5f1e8b894 lock-util: add a new lock_generic_with_timeout() helper
This is just like lock_generic(), but applies the lock with a timeout.
This requires jumping through some hoops by executing things in a child
process, so that we can abort if necessary via a timer. Linux after all
has no native way to take file locks with a timeout.
2023-11-02 14:19:32 +01:00
Daan De Meyer 0867a46534 lock-util: Add LOCK_NONE 2023-06-15 17:10:35 +02:00
Daan De Meyer 2646b86dd6 fs-util: Add xopenat_lock()
open/create a file/directory and lock it using the given lock type.
2023-03-22 21:54:20 +01:00
Daan De Meyer aea3ca3613 lock-util: Add make_lock_file_at() 2023-03-21 15:19:33 +01:00
Daan De Meyer 846c9c12e7 lock-util: Add posix_lock()
POSIX locks with the same interface as flock().
2023-03-13 13:04:08 +01:00
Daan De Meyer 4dd888dc92 lock-util: Move to src/basic 2023-03-10 11:57:43 +01:00