DEFINE_POINTER_ARRAY_CLEAR_FUNC() generates a helper of the form helper_array_clear(T *array, size_t n) that drops each element but does not free the array itself, parallel to DEFINE_POINTER_ARRAY_FREE_FUNC() for cases where the array has automatic storage duration. CLEANUP_ELEMENTS() pairs with these helpers to provide a _cleanup_-like attribute for fixed-size arrays: the bound is taken from ELEMENTSOF(), and the helper is invoked across the elements at scope exit. Compared to CLEANUP_ARRAY(), the storage is neither freed nor zeroed. Migrate various logic across the tree over to the new macros. sd-device: use DEFINE_POINTER_ARRAY_CLEAR_FUNC() for sd_device_unref_array_clear() Replace the local device_unref_many() helper with the macro-generated equivalent. format-table: switch help-table arrays to CLEANUP_ELEMENTS() Generate table_unref_array_clear() via DEFINE_POINTER_ARRAY_CLEAR_FUNC() and convert the help-table arrays in bootctl, cryptenroll, nspawn, repart and vmspawn to CLEANUP_ELEMENTS(). The arrays no longer need a trailing NULL slot, so the size matches ELEMENTSOF() of the groups array. firewall-util: switch netlink message arrays to CLEANUP_ELEMENTS() Generate sd_netlink_message_unref_array_clear() via DEFINE_POINTER_ARRAY_CLEAR_FUNC() in place of the NULL-terminated sd_netlink_message_unref_many(), and convert the two stack arrays of sd_netlink_message pointers to CLEANUP_ELEMENTS().
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list, join our IRC channel #systemd on libera.chat or Matrix channel
Stable branches with backported patches are available in the stable repo.
We have a security bug bounty program sponsored by the Sovereign Tech Fund hosted on YesWeHack
Repositories with distribution packages built from git main are available on OBS, and also repositories with packages built from the latest stable release
