summaryrefslogtreecommitdiffstats
path: root/include/pathnames.h
blob: 81fa405f63c7fdd19dc25134bdef71dfaffb27cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
/*
 * No copyright is claimed.  This code is in the public domain; do with
 * it what you wish.
 */
#ifndef PATHNAMES_H
#define PATHNAMES_H

#ifdef HAVE_PATHS_H
# include <paths.h>
#endif

#ifndef __STDC__
# error "we need an ANSI compiler"
#endif

/* used by kernel in /proc (e.g. /proc/swaps) for deleted files */
#define PATH_DELETED_SUFFIX	" (deleted)"

/* DEFPATHs from <paths.h> don't include /usr/local */
#undef _PATH_DEFPATH

#ifdef USE_USRDIR_PATHS_ONLY
# define _PATH_DEFPATH	        "/usr/local/bin:/usr/bin"
#else
# define _PATH_DEFPATH	        "/usr/local/bin:/bin:/usr/bin"
#endif

#undef _PATH_DEFPATH_ROOT

#ifdef USE_USRDIR_PATHS_ONLY
# define _PATH_DEFPATH_ROOT	"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
#else
# define _PATH_DEFPATH_ROOT	"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
#endif

#define	_PATH_HUSHLOGIN		".hushlogin"
#define	_PATH_HUSHLOGINS	"/etc/hushlogins"

#define _PATH_NOLOGIN_TXT	"/etc/nologin.txt"

#ifndef _PATH_MAILDIR
# define _PATH_MAILDIR		"/var/spool/mail"
#endif
#define	_PATH_MOTDFILE		"/usr/share/misc/motd:/run/motd:/etc/motd"
#ifndef _PATH_NOLOGIN
# define _PATH_NOLOGIN		"/etc/nologin"
#endif
#define	_PATH_VAR_NOLOGIN	"/var/run/nologin"

#ifndef _PATH_LOGIN
# define _PATH_LOGIN		"/bin/login"
#endif
#define _PATH_SHUTDOWN		"/sbin/shutdown"
#define _PATH_POWEROFF		"/sbin/poweroff"

#define _PATH_TERMCOLORS_DIRNAME "terminal-colors.d"
#define _PATH_TERMCOLORS_DIR	"/etc/" _PATH_TERMCOLORS_DIRNAME

/* login paths */
#define _PATH_PASSWD		"/etc/passwd"
#define _PATH_GSHADOW		"/etc/gshadow"
#define _PATH_GROUP		"/etc/group"
#define _PATH_SHADOW_PASSWD	"/etc/shadow"
#define _PATH_SHELLS		"/etc/shells"

#ifndef _PATH_TMP
# define _PATH_TMP		"/tmp/"
#endif

#ifndef _PATH_BTMP
# define _PATH_BTMP		"/var/log/btmp"
#endif

#define _PATH_ISSUE_FILENAME	"issue"
#define _PATH_ISSUE_DIRNAME	_PATH_ISSUE_FILENAME ".d"

#define _PATH_ISSUE		"/etc/" _PATH_ISSUE_FILENAME
#define _PATH_ISSUEDIR		"/etc/" _PATH_ISSUE_DIRNAME

#define _PATH_OS_RELEASE_ETC	"/etc/os-release"
#define _PATH_OS_RELEASE_USR	"/usr/lib/os-release"
#define _PATH_NUMLOCK_ON	_PATH_RUNSTATEDIR "/numlock-on"
#define _PATH_LOGINDEFS		"/etc/login.defs"

#define _PATH_SD_UNITSLOAD	_PATH_RUNSTATEDIR "/systemd/systemd-units-load"

/* misc paths */
#define _PATH_WORDS             "/usr/share/dict/words"
#define _PATH_WORDS_ALT         "/usr/share/dict/web2"

/* mount paths */
#define _PATH_FILESYSTEMS	"/etc/filesystems"
#define _PATH_PROC		"/proc"
#define _PATH_PROC_SWAPS	"/proc/swaps"
#define _PATH_PROC_FILESYSTEMS	"/proc/filesystems"
#define _PATH_PROC_MOUNTS	"/proc/mounts"
#define _PATH_PROC_PARTITIONS	"/proc/partitions"
#define _PATH_PROC_DEVICES	"/proc/devices"
#define _PATH_PROC_MOUNTINFO	"/proc/self/mountinfo"
#define _PATH_PROC_LOCKS        "/proc/locks"
#define _PATH_PROC_CDROMINFO	"/proc/sys/dev/cdrom/info"

/* unshare paths */
#define _PATH_SUBUID		"/etc/subuid"
#define _PATH_SUBGID		"/etc/subgid"
#define _PATH_PROC_UIDMAP	"/proc/self/uid_map"
#define _PATH_PROC_GIDMAP	"/proc/self/gid_map"
#define _PATH_PROC_SETGROUPS	"/proc/self/setgroups"

#define _PATH_PROC_FDDIR	"/proc/self/fd"
#define _PATH_PROC_TIMENS_OFF   "/proc/self/timens_offsets"

#define _PATH_PROC_ATTR_CURRENT	"/proc/self/attr/current"
#define _PATH_PROC_ATTR_EXEC	"/proc/self/attr/exec"
#define _PATH_PROC_CAPLASTCAP	"/proc/sys/kernel/cap_last_cap"


#define _PATH_SYS_BLOCK		"/sys/block"
#define _PATH_SYS_DEVBLOCK	"/sys/dev/block"
#define _PATH_SYS_DEVCHAR	"/sys/dev/char"
#define _PATH_SYS_CLASS		"/sys/class"
#define _PATH_SYS_SCSI		"/sys/bus/scsi"
#define _PATH_SYS_CPU_BYTEORDER	"/sys/kernel/cpu_byteorder"
#define _PATH_SYS_ADDRESS_BITS	"/sys/kernel/address_bits"

#define _PATH_SYS_SELINUX	"/sys/fs/selinux"
#define _PATH_SYS_APPARMOR	"/sys/kernel/security/apparmor"

#ifndef _PATH_MOUNTED
# ifdef MOUNTED					/* deprecated */
#  define _PATH_MOUNTED		MOUNTED
# else
#  define _PATH_MOUNTED		"/etc/mtab"
# endif
#endif

#ifndef _PATH_MNTTAB
# ifdef MNTTAB					/* deprecated */
#  define _PATH_MNTTAB		MNTTAB
# else
#  define _PATH_MNTTAB		"/etc/fstab"
# endif
#endif

#ifndef _PATH_DEV
  /*
   * The tailing '/' in _PATH_DEV is there for compatibility with libc.
   */
# define _PATH_DEV		"/dev/"
#endif

#define _PATH_DEV_MAPPER	"/dev/mapper"

#define _PATH_DEV_MEM		"/dev/mem"

#define _PATH_DEV_LOOP		"/dev/loop"
#define _PATH_DEV_LOOPCTL	"/dev/loop-control"

/* udev paths */
#define _PATH_DEV_BYLABEL	"/dev/disk/by-label"
#define _PATH_DEV_BYUUID	"/dev/disk/by-uuid"
#define _PATH_DEV_BYID		"/dev/disk/by-id"
#define _PATH_DEV_BYPATH	"/dev/disk/by-path"
#define _PATH_DEV_BYPARTLABEL	"/dev/disk/by-partlabel"
#define _PATH_DEV_BYPARTUUID	"/dev/disk/by-partuuid"

/* hwclock paths */
#ifdef CONFIG_ADJTIME_PATH
# define _PATH_ADJTIME		CONFIG_ADJTIME_PATH
#else
# define _PATH_ADJTIME		"/etc/adjtime"
#endif

#ifdef __ia64__
# define _PATH_RTC_DEV		"/dev/efirtc"
#else
# define _PATH_RTC_DEV		"/dev/rtc0"
#endif

/* raw paths*/
#define _PATH_RAWDEVDIR		"/dev/raw/"
#define _PATH_RAWDEVCTL		_PATH_RAWDEVDIR "rawctl"
/* deprecated */
#define _PATH_RAWDEVCTL_OLD	"/dev/rawctl"

#define _PATH_PROC_KERNEL	"/proc/sys/kernel"

/* ipc paths */
#define _PATH_PROC_SYSV_MSG	"/proc/sysvipc/msg"
#define _PATH_PROC_SYSV_SEM	"/proc/sysvipc/sem"
#define _PATH_PROC_SYSV_SHM	"/proc/sysvipc/shm"
#define _PATH_PROC_IPC_MSGMAX	_PATH_PROC_KERNEL "/msgmax"
#define _PATH_PROC_IPC_MSGMNB	_PATH_PROC_KERNEL "/msgmnb"
#define _PATH_PROC_IPC_MSGMNI	_PATH_PROC_KERNEL "/msgmni"
#define _PATH_PROC_IPC_SEM	_PATH_PROC_KERNEL "/sem"
#define _PATH_PROC_IPC_SHMALL	_PATH_PROC_KERNEL "/shmall"
#define _PATH_PROC_IPC_SHMMAX	_PATH_PROC_KERNEL "/shmmax"
#define _PATH_PROC_IPC_SHMMNI	_PATH_PROC_KERNEL "/shmmni"

/* util clamp */
#define _PATH_PROC_UCLAMP_MIN	_PATH_PROC_KERNEL "/sched_util_clamp_min"
#define _PATH_PROC_UCLAMP_MAX	_PATH_PROC_KERNEL "/sched_util_clamp_max"

/* sysctl fs paths */
#define _PATH_PROC_SYS_FS	"/proc/sys/fs"
#define _PATH_PROC_PIPE_MAX_SIZE	_PATH_PROC_SYS_FS "/pipe-max-size"

/* irqtop paths */
#define _PATH_PROC_INTERRUPTS	"/proc/interrupts"
#define _PATH_PROC_SOFTIRQS	"/proc/softirqs"
#define _PATH_PROC_UPTIME	"/proc/uptime"

/* kernel command line */
#define _PATH_PROC_CMDLINE	"/proc/cmdline"


/* logger paths */
#define _PATH_DEVLOG		"/dev/log"

/* ctrlaltdel paths */
#define _PATH_PROC_CTRL_ALT_DEL	"/proc/sys/kernel/ctrl-alt-del"

/* lscpu paths */
#define _PATH_PROC_CPUINFO	"/proc/cpuinfo"

/* rfkill paths */
#define _PATH_DEV_RFKILL	"/dev/rfkill"
#define _PATH_SYS_RFKILL	"/sys/class/rfkill"

/* cgroup path */
#define _PATH_SYS_CGROUP	"/sys/fs/cgroup"

/* Maximum number of PIDs system supports */
#define _PATH_PROC_PIDMAX	"/proc/sys/kernel/pid_max"

#endif /* PATHNAMES_H */