Commit Graph

2386 Commits

Author SHA1 Message Date
Yu Watanabe
dea72eda9c missing: move fcntl related definitions to missing_fcntl.h 2018-12-06 13:25:24 +01:00
Yu Watanabe
6c76de27ee missing: move resource related definitions to missing_resource.h 2018-12-06 13:25:24 +01:00
Yu Watanabe
0e7117d001 missing: move audit related definitions to missing_audit.h 2018-12-06 13:25:24 +01:00
Yu Watanabe
851d66fac2 missing: move syscall related definitions to missing_syscall.h 2018-12-06 13:25:24 +01:00
Yu Watanabe
bd0937ddb3 random-util: drop duplicated linux/random.h 2018-12-06 13:25:24 +01:00
Yu Watanabe
49f6103375 missing: drop old OOM related definitions
These are exposed earlier than linux-3.11. Let's just include linux/oom.h.
2018-12-06 13:24:37 +01:00
Yu Watanabe
8f8495702e missing: move one more network related definition to missing_network.h 2018-12-06 13:24:32 +01:00
Yu Watanabe
9cb6c6ecb0 missing: use integer types used by kernel
By using them, we can decrease included headers except linux/types.h.
2018-12-06 13:24:00 +01:00
Yu Watanabe
666a84eaca macro: include errno.h
As several macros touch errno.
2018-12-06 07:01:29 +01:00
Yu Watanabe
ec3f6df9cf missing: move several network related entries to missing_network.h 2018-12-06 02:38:59 +01:00
Lennart Poettering
085b39e9df socket-util: Let's trick out ubsan when it validate struct sockaddr_un.sun_path[]
Linux is stupid and sometimes returns a "struct sockaddr_un" that is
longer than its fields, as it NUL terminates .sun_path[] even if it has
full length. ubsan detects this, rightfully. Since this is a Linux
misdesign let's trick out ubsan a bit.

Fixes: #11024
2018-12-04 23:28:14 +01:00
Lennart Poettering
836f9cfebd socket-util: break lines in sockaddr_pretty() signature
It's soo long, let's make this more readable.
2018-12-04 23:28:14 +01:00
Lennart Poettering
994b9d4e90 socket-util: shorten code a bit 2018-12-04 23:28:14 +01:00
Lennart Poettering
ee589a1882 Merge pull request #11041 from yuwata/update-missing-v2
missing: separate missing.h more
2018-12-04 16:19:02 +01:00
Yu Watanabe
36dd5ffd5d util: drop missing.h from util.h 2018-12-04 10:00:34 +01:00
Yu Watanabe
f2a3de0116 tree-wide: add whitespace between type and variable name 2018-12-04 09:29:54 +01:00
Yu Watanabe
38e0c63d72 missing: move char{16,32}_t definitions to missing_type.h 2018-12-04 08:38:18 +01:00
Yu Watanabe
8ca2702f00 missing: move capabilities to missing_capability.h 2018-12-04 08:38:14 +01:00
Yu Watanabe
2a03bb3e65 missing: move prctl related entries to missing_prctl.h 2018-12-04 08:34:46 +01:00
Yu Watanabe
e01819f84b missing: move statx related definitions to missing_stat.h 2018-12-04 08:27:50 +01:00
Yu Watanabe
1e54f0ab15 missing: move entries defined in magic.h to missing_magic.h 2018-12-04 07:55:23 +01:00
Yu Watanabe
31c2ddabea missing: move input related entries to missing_input.h 2018-12-04 07:51:52 +01:00
Yu Watanabe
3843e8260c missing: rename securebits.h to missing_securebits.h 2018-12-04 07:49:24 +01:00
Yu Watanabe
b9683baffe missing: move btrfs related entries to missing_btrfs.h and missing_btrfs_tree.h 2018-12-04 07:46:59 +01:00
Yu Watanabe
d7276b61bd missing: move missing entries in keyctl.h to missing_keyctl.h 2018-12-04 07:42:32 +01:00
Yu Watanabe
475c18f06a meson: add missing missing_*.h 2018-12-04 07:34:47 +01:00
Yu Watanabe
22b749d6ef missing: rearrange missing_if_link.h to support centos 2018-12-04 02:35:36 +01:00
Yu Watanabe
b6459df80f missing: re-add mistakenly dropped entries
These entries are mistakenly dropped by 9714c020fc.

Fixes #11036.
2018-12-04 01:45:14 +01:00
Lennart Poettering
63e688cc3b Merge pull request #11031 from poettering/gcc-attr-cleanup
various gcc attribute clean-ups
2018-12-03 21:59:00 +01:00
Lennart Poettering
76b31bbb24 Merge pull request #10920 from yuwata/hashmap-destructor
hashmap: make hashmap_free() call destructors of key or value
2018-12-03 17:59:44 +01:00
Lennart Poettering
a20f73221a Merge pull request #10976 from yuwata/typesafe-netlink-call
netlink: introduce typesafe netlink functions
2018-12-03 17:55:00 +01:00
Lennart Poettering
7fdf40d247 static-destruct: turn on new _variable_no_sanitize_address_ variable for STATIC_DESTRUCTOR_REGISTER 2018-12-03 17:35:50 +01:00
Lennart Poettering
026c2677fc macro: add macro for llvm no_sanitize_address attribute
We want it for global variables, which LLVM supports and GCC currently
does not (GCC does support it for functions, but we care about global
variables here).

Why is this relevant? When asan is used global variables are padded with
hotzones before and after. But we can't have that for the registration
variables we place in special ELF sections: we want them tightly packed
so that we can iterate through them.

Note that for gcc this isn't an issue, as it will pack stuff in
non-standard sections anyway, even if asan is used.
2018-12-03 17:35:50 +01:00
Lennart Poettering
be5f77b26e macro: define HAS_FEATURE_ADDRESS_SANITIZER also on gcc
Let's make differences between compilers more minimal.
2018-12-03 17:35:50 +01:00
Evgeny Vereshchagin
289acab951 util-lib: introduce HAS_FEATURE_ADDRESS_SANITIZER
https://clang.llvm.org/docs/AddressSanitizer.html#conditional-compilation-with-has-feature-address-sanitizer
2018-12-03 17:35:42 +01:00
Lennart Poettering
a898603563 sd-bus,static-destruct: clean up how we do our ELF section magic
This cleans up a bit how we set up things for the ELF section magic:

1. Let's always use our gcc macros, instead of __attribute__ directly

2. Align our structures to sizeof(void*), i.e. the pointer size, rather
   than a fixed 8 or __BIGGEST_ALIGNMENT__. The former is unnecessarily
   high for 32bit systems, the latter too high for 64bit systems. gcc
   seems to use ptr alignment for static variables itself, hence this
   should be good enough for us too. Moreover, the Linux kernel also
   uses pointer alginment for all its ELF section registration magic,
   hence this should be good enough for us too.

3. Let's always prefix the sections we create ourself with SYSTEMD_,
   just to make clear where they come from.

4. Always align the pointer we start from when iterating through these
   lists. This should be unnecessary, but makes things nicely
   systematic, as we'll align all pointers we use to access these
   sections properly.
2018-12-03 13:28:26 +01:00
Lennart Poettering
2ee1c55d6c tree-wide: drop redundant space between __attribute__ and ((
We follow no general rule, but in most cases we do not place a space
outside of macro.h. Hence let's stick to that, and adapt macro.h too,
and follow the rule systematically that there shall not be a space
between __attribute__ and ((...

Yes, this does not matter at all, and is purely OCD cosmetics. But then
again, the uses of __attribute__ are very local only, hence the changes
cleaning this up are small and are unlikely to have to be repeated too
often...
2018-12-03 13:28:26 +01:00
Lennart Poettering
d752090f3e macro: add macros for a couple of more gcc attributes we use 2018-12-03 13:28:26 +01:00
Lennart Poettering
d34dae1817 tree-wide: use gcc attribute macros where appropriate
We have these macros already, hence use them.
2018-12-03 13:28:26 +01:00
Lennart Poettering
ad2bf5df89 Merge pull request #10992 from yuwata/follow-up-10948
network: make fib rule accept arbitrary ip protocol
2018-12-03 11:09:04 +01:00
Yu Watanabe
9714c020fc missing: split network related entries
Also adds comments which kernel version added the entries.

Closes #10553.
2018-12-03 10:31:05 +01:00
Lennart Poettering
686d13b9f2 util-lib: split out env file parsing code into env-file.c
It's quite complex, let's split this out.

No code changes, just some file rearranging.
2018-12-02 13:22:29 +01:00
Lennart Poettering
0a2152f005 util-lib: move open_serialization_fd() to serialize.c
It definitely fits better there.

No code changes, just some rearranging.
2018-12-02 13:22:29 +01:00
Lennart Poettering
e4de72876e util-lib: split out all temporary file related calls into tmpfiles-util.c
This splits out a bunch of functions from fileio.c that have to do with
temporary files. Simply to make the header files a bit shorter, and to
group things more nicely.

No code changes, just some rearranging of source files.
2018-12-02 13:22:29 +01:00
Lennart Poettering
603772810c fileio: remove unnecessary initialization 2018-12-02 13:22:28 +01:00
Lennart Poettering
8bdc9a90db fileio: include ctype.h with <> rather than ""
It's a system header after all.
2018-12-02 13:22:28 +01:00
Yu Watanabe
59a5cda7b9 hash-func: add destructors for key and value
If they are set, then they are called in hashmap_clear() or
hashmap_free().
2018-12-02 11:59:07 +01:00
Yu Watanabe
7a08d314f2 tree-wide: make hash_ops typesafe 2018-12-02 07:53:27 +01:00
Yu Watanabe
25073e5012 hash-funcs: make basic hash_ops typesafe 2018-12-02 07:48:29 +01:00
Yu Watanabe
d1005d1c00 hash-funcs: introduce macro to create typesafe hash_ops 2018-12-02 07:48:12 +01:00