]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/format-util.h
d9a78f7811740ac2a9b219c99dc0ca5ca4eed8bd
1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 This file is part of systemd.
7 Copyright 2015 Ronny Chevalier
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
26 # define PID_PRI PRIi32
27 #elif SIZEOF_PID_T == 2
28 # define PID_PRI PRIi16
30 # error Unknown pid_t size
32 #define PID_FMT "%" PID_PRI
35 # define UID_FMT "%" PRIu32
36 #elif SIZEOF_UID_T == 2
37 # define UID_FMT "%" PRIu16
39 # error Unknown uid_t size
43 # define GID_FMT "%" PRIu32
44 #elif SIZEOF_GID_T == 2
45 # define GID_FMT "%" PRIu16
47 # error Unknown gid_t size
50 #if SIZEOF_TIME_T == 8
51 # define PRI_TIME PRIi64
52 #elif SIZEOF_TIME_T == 4
53 # define PRI_TIME "li"
55 # error Unknown time_t size
58 #if defined __x86_64__ && defined __ILP32__
59 # define PRI_TIMEX PRIi64
61 # define PRI_TIMEX "li"
64 #if SIZEOF_RLIM_T == 8
65 # define RLIM_FMT "%" PRIu64
66 #elif SIZEOF_RLIM_T == 4
67 # define RLIM_FMT "%" PRIu32
69 # error Unknown rlim_t size
73 # define DEV_FMT "%" PRIu64
74 #elif SIZEOF_DEV_T == 4
75 # define DEV_FMT "%" PRIu32
77 # error Unknown dev_t size
81 # define INO_FMT "%" PRIu64
82 #elif SIZEOF_INO_T == 4
83 # define INO_FMT "%" PRIu32
85 # error Unknown ino_t size