]> git.ipfire.org Git - thirdparty/util-linux.git/blob - include/pathnames.h
Merge branch 'lsclocks/rtc' of https://github.com/t-8ch/util-linux
[thirdparty/util-linux.git] / include / pathnames.h
1 /*
2 * No copyright is claimed. This code is in the public domain; do with
3 * it what you wish.
4 */
5 #ifndef PATHNAMES_H
6 #define PATHNAMES_H
7
8 #ifdef HAVE_PATHS_H
9 # include <paths.h>
10 #endif
11
12 #ifndef __STDC__
13 # error "we need an ANSI compiler"
14 #endif
15
16 /* used by kernel in /proc (e.g. /proc/swaps) for deleted files */
17 #define PATH_DELETED_SUFFIX " (deleted)"
18
19 /* DEFPATHs from <paths.h> don't include /usr/local */
20 #undef _PATH_DEFPATH
21
22 #ifdef USE_USRDIR_PATHS_ONLY
23 # define _PATH_DEFPATH "/usr/local/bin:/usr/bin"
24 #else
25 # define _PATH_DEFPATH "/usr/local/bin:/bin:/usr/bin"
26 #endif
27
28 #undef _PATH_DEFPATH_ROOT
29
30 #ifdef USE_USRDIR_PATHS_ONLY
31 # define _PATH_DEFPATH_ROOT "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
32 #else
33 # define _PATH_DEFPATH_ROOT "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
34 #endif
35
36 #define _PATH_HUSHLOGIN ".hushlogin"
37 #define _PATH_HUSHLOGINS "/etc/hushlogins"
38
39 #define _PATH_NOLOGIN_TXT "/etc/nologin.txt"
40
41 #ifndef _PATH_MAILDIR
42 # define _PATH_MAILDIR "/var/spool/mail"
43 #endif
44 #define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/etc/motd"
45 #ifndef _PATH_NOLOGIN
46 # define _PATH_NOLOGIN "/etc/nologin"
47 #endif
48 #define _PATH_VAR_NOLOGIN "/var/run/nologin"
49
50 #ifndef _PATH_LOGIN
51 # define _PATH_LOGIN "/bin/login"
52 #endif
53 #define _PATH_SHUTDOWN "/sbin/shutdown"
54 #define _PATH_POWEROFF "/sbin/poweroff"
55
56 #define _PATH_TERMCOLORS_DIRNAME "terminal-colors.d"
57 #define _PATH_TERMCOLORS_DIR "/etc/" _PATH_TERMCOLORS_DIRNAME
58
59 /* login paths */
60 #define _PATH_PASSWD "/etc/passwd"
61 #define _PATH_GSHADOW "/etc/gshadow"
62 #define _PATH_GROUP "/etc/group"
63 #define _PATH_SHADOW_PASSWD "/etc/shadow"
64 #define _PATH_SHELLS "/etc/shells"
65
66 #ifndef _PATH_TMP
67 # define _PATH_TMP "/tmp/"
68 #endif
69
70 #ifndef _PATH_BTMP
71 # define _PATH_BTMP "/var/log/btmp"
72 #endif
73
74 #define _PATH_ISSUE_FILENAME "issue"
75 #define _PATH_ISSUE_DIRNAME _PATH_ISSUE_FILENAME ".d"
76
77 #define _PATH_ISSUE "/etc/" _PATH_ISSUE_FILENAME
78 #define _PATH_ISSUEDIR "/etc/" _PATH_ISSUE_DIRNAME
79
80 #define _PATH_OS_RELEASE_ETC "/etc/os-release"
81 #define _PATH_OS_RELEASE_USR "/usr/lib/os-release"
82 #define _PATH_NUMLOCK_ON _PATH_RUNSTATEDIR "/numlock-on"
83 #define _PATH_LOGINDEFS "/etc/login.defs"
84
85 #define _PATH_SD_UNITSLOAD _PATH_RUNSTATEDIR "/systemd/systemd-units-load"
86
87 /* misc paths */
88 #define _PATH_WORDS "/usr/share/dict/words"
89 #define _PATH_WORDS_ALT "/usr/share/dict/web2"
90
91 /* mount paths */
92 #define _PATH_FILESYSTEMS "/etc/filesystems"
93 #define _PATH_PROC "/proc"
94 #define _PATH_PROC_SWAPS "/proc/swaps"
95 #define _PATH_PROC_FILESYSTEMS "/proc/filesystems"
96 #define _PATH_PROC_MOUNTS "/proc/mounts"
97 #define _PATH_PROC_PARTITIONS "/proc/partitions"
98 #define _PATH_PROC_DEVICES "/proc/devices"
99 #define _PATH_PROC_MOUNTINFO "/proc/self/mountinfo"
100 #define _PATH_PROC_LOCKS "/proc/locks"
101 #define _PATH_PROC_CDROMINFO "/proc/sys/dev/cdrom/info"
102
103 /* unshare paths */
104 #define _PATH_SUBUID "/etc/subuid"
105 #define _PATH_SUBGID "/etc/subgid"
106 #define _PATH_PROC_UIDMAP "/proc/self/uid_map"
107 #define _PATH_PROC_GIDMAP "/proc/self/gid_map"
108 #define _PATH_PROC_SETGROUPS "/proc/self/setgroups"
109
110 #define _PATH_PROC_FDDIR "/proc/self/fd"
111 #define _PATH_PROC_TIMENS_OFF "/proc/self/timens_offsets"
112
113 #define _PATH_PROC_ATTR_CURRENT "/proc/self/attr/current"
114 #define _PATH_PROC_ATTR_EXEC "/proc/self/attr/exec"
115 #define _PATH_PROC_CAPLASTCAP "/proc/sys/kernel/cap_last_cap"
116
117
118 #define _PATH_SYS_BLOCK "/sys/block"
119 #define _PATH_SYS_DEVBLOCK "/sys/dev/block"
120 #define _PATH_SYS_DEVCHAR "/sys/dev/char"
121 #define _PATH_SYS_CLASS "/sys/class"
122 #define _PATH_SYS_SCSI "/sys/bus/scsi"
123 #define _PATH_SYS_CPU_BYTEORDER "/sys/kernel/cpu_byteorder"
124 #define _PATH_SYS_ADDRESS_BITS "/sys/kernel/address_bits"
125
126 #define _PATH_SYS_SELINUX "/sys/fs/selinux"
127 #define _PATH_SYS_APPARMOR "/sys/kernel/security/apparmor"
128
129 #ifndef _PATH_MOUNTED
130 # ifdef MOUNTED /* deprecated */
131 # define _PATH_MOUNTED MOUNTED
132 # else
133 # define _PATH_MOUNTED "/etc/mtab"
134 # endif
135 #endif
136
137 #ifndef _PATH_MNTTAB
138 # ifdef MNTTAB /* deprecated */
139 # define _PATH_MNTTAB MNTTAB
140 # else
141 # define _PATH_MNTTAB "/etc/fstab"
142 # endif
143 #endif
144
145 #ifndef _PATH_DEV
146 /*
147 * The tailing '/' in _PATH_DEV is there for compatibility with libc.
148 */
149 # define _PATH_DEV "/dev/"
150 #endif
151
152 #define _PATH_DEV_MAPPER "/dev/mapper"
153
154 #define _PATH_DEV_MEM "/dev/mem"
155
156 #define _PATH_DEV_LOOP "/dev/loop"
157 #define _PATH_DEV_LOOPCTL "/dev/loop-control"
158
159 /* udev paths */
160 #define _PATH_DEV_BYLABEL "/dev/disk/by-label"
161 #define _PATH_DEV_BYUUID "/dev/disk/by-uuid"
162 #define _PATH_DEV_BYID "/dev/disk/by-id"
163 #define _PATH_DEV_BYPATH "/dev/disk/by-path"
164 #define _PATH_DEV_BYPARTLABEL "/dev/disk/by-partlabel"
165 #define _PATH_DEV_BYPARTUUID "/dev/disk/by-partuuid"
166
167 /* hwclock paths */
168 #ifdef CONFIG_ADJTIME_PATH
169 # define _PATH_ADJTIME CONFIG_ADJTIME_PATH
170 #else
171 # define _PATH_ADJTIME "/etc/adjtime"
172 #endif
173
174 #ifdef __ia64__
175 # define _PATH_RTC_DEV "/dev/efirtc"
176 #else
177 # define _PATH_RTC_DEV "/dev/rtc0"
178 #endif
179
180 /* raw paths*/
181 #define _PATH_RAWDEVDIR "/dev/raw/"
182 #define _PATH_RAWDEVCTL _PATH_RAWDEVDIR "rawctl"
183 /* deprecated */
184 #define _PATH_RAWDEVCTL_OLD "/dev/rawctl"
185
186 #define _PATH_PROC_KERNEL "/proc/sys/kernel"
187
188 /* ipc paths */
189 #define _PATH_PROC_SYSV_MSG "/proc/sysvipc/msg"
190 #define _PATH_PROC_SYSV_SEM "/proc/sysvipc/sem"
191 #define _PATH_PROC_SYSV_SHM "/proc/sysvipc/shm"
192 #define _PATH_PROC_IPC_MSGMAX _PATH_PROC_KERNEL "/msgmax"
193 #define _PATH_PROC_IPC_MSGMNB _PATH_PROC_KERNEL "/msgmnb"
194 #define _PATH_PROC_IPC_MSGMNI _PATH_PROC_KERNEL "/msgmni"
195 #define _PATH_PROC_IPC_SEM _PATH_PROC_KERNEL "/sem"
196 #define _PATH_PROC_IPC_SHMALL _PATH_PROC_KERNEL "/shmall"
197 #define _PATH_PROC_IPC_SHMMAX _PATH_PROC_KERNEL "/shmmax"
198 #define _PATH_PROC_IPC_SHMMNI _PATH_PROC_KERNEL "/shmmni"
199
200 /* util clamp */
201 #define _PATH_PROC_UCLAMP_MIN _PATH_PROC_KERNEL "/sched_util_clamp_min"
202 #define _PATH_PROC_UCLAMP_MAX _PATH_PROC_KERNEL "/sched_util_clamp_max"
203
204 /* sysctl fs paths */
205 #define _PATH_PROC_SYS_FS "/proc/sys/fs"
206 #define _PATH_PROC_PIPE_MAX_SIZE _PATH_PROC_SYS_FS "/pipe-max-size"
207
208 /* irqtop paths */
209 #define _PATH_PROC_INTERRUPTS "/proc/interrupts"
210 #define _PATH_PROC_SOFTIRQS "/proc/softirqs"
211 #define _PATH_PROC_UPTIME "/proc/uptime"
212
213 /* kernel command line */
214 #define _PATH_PROC_CMDLINE "/proc/cmdline"
215
216
217 /* logger paths */
218 #define _PATH_DEVLOG "/dev/log"
219
220 /* ctrlaltdel paths */
221 #define _PATH_PROC_CTRL_ALT_DEL "/proc/sys/kernel/ctrl-alt-del"
222
223 /* lscpu paths */
224 #define _PATH_PROC_CPUINFO "/proc/cpuinfo"
225
226 /* rfkill paths */
227 #define _PATH_DEV_RFKILL "/dev/rfkill"
228 #define _PATH_SYS_RFKILL "/sys/class/rfkill"
229
230 /* cgroup path */
231 #define _PATH_SYS_CGROUP "/sys/fs/cgroup"
232
233 #endif /* PATHNAMES_H */