Skip to content

Commit 89a22c6

Browse files
asder8215tgross35
authored andcommitted
Unix: Add _PATH_BSHELL and _PATH_DEFPATH where available. The following are sources to each platform's paths.h:
From BSD: * [Apple](https://github.com/apple-oss-distributions/Libc/blob/71bbe350ab79eef58113991d817ccc6165061a64/include/paths.h#L65): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [Dragonfly](https://github.com/DragonFlyBSD/DragonFlyBSD/blob/42aaacafd14ddb7f660730a5ca5da0a2d941723a/include/paths.h#L40): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [FreeBSD](https://github.com/freebsd/freebsd-src/blob/551b7c5e12bfea623a47edf97ad5689732a1233f/include/paths.h#L40): Has `_PATH_BSHELL` and `_PATH_DEFPATH` (verified same values on version 11+) * [NetBSD](https://github.com/NetBSD/src/blob/f66621237dc60126bd8a972b6064639892b344b7/include/paths.h#L43): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [OpenBSD](https://github.com/openbsd/src/blob/7d89a3e823169cb6a1d989e3f5f93f7f3c4b5db4/include/paths.h#L39): Has `_PATH_BSHELL` and `_PATH_DEFPATH` From Linux: * [Android](https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/paths.h#48): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [glibc](https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/paths.h;h=1342ab3a96ab12065311b718e57e7235e07587f8;hb=HEAD#l36): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [musl](https://git.musl-libc.org/cgit/musl/tree/include/paths.h?id=f21a96538f78fa8e2040831b4209b35f2fb581da#n4): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [uClibc](https://github.com/kraj/uClibc/blob/ca1c74d67dd115d059a875150e10b8560a9c35a8/include/paths.h#L36): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [emscripten](https://github.com/emscripten-core/emscripten/blob/a2059f978ed206b688daf4a8774211949610c2aa/system/lib/libc/musl/include/paths.h#L4): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * l4re: There's [musl](https://github.com/l4re/l4re-core/blob/d09b1619c45d17786bc256ea219688f8ba3ff1fe/libc/musl/contrib/musl/include/paths.h#L4) and [uclibc](https://github.com/l4re/l4re-core/blob/d09b1619c45d17786bc256ea219688f8ba3ff1fe/libc/uclibc-ng/contrib/uclibc/include/paths.h#L36) `paths.h` file containing `_PATH_BSHELL` and `_PATH_DEFPATH` values Miscellaneous Platforms: * [Haiku](https://github.com/haiku/haiku/blob/8a33129223e93ea046dc62e9e09f8c93f45cfb7b/headers/compatibility/bsd/paths.h#L45): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [Hurd](https://github.com/joshumax/hurd/blob/83a6fc7641eecdb2b96c2dee2261da92573693de/hurd/paths.h#L20): Doesn't have `_PATH_BSHELL` and `_PATH_DEFPATH` in paths.h (wouldn't hurt to confirm this though in terminal) * [Cygwin](https://github.com/cygwin/cygwin/blob/cf61e0140e3d6cd21e743a38d35efc98194b63f3/winsup/cygwin/include/paths.h#L12): Has `_PATH_BSHELL` and `_PATH_DEFPATH` * [newlib](https://github.com/ourairquality/newlib/blob/0dea38754696422d526543262274703acd8317c5/newlib/libc/include/paths.h#L7): Has `_PATH_BSHELL` * [Redox](https://gitlab.redox-os.org/redox-os/relibc/-/blob/c3b3f2773a3a2622fdb632a9bfa1a77d68778150/include/paths.h): Has `_PATH_BSHELL` Platforms I'm unsure if they have `_PATH_BSHELL`/`_PATH_DEFPATH`: * Solarish: I'm unsure how to get this info since I believe Solaris is closed source? * AIX: I think this is also closed source? However, I saw this [archive repo](https://github.com/Arquivotheca/AIX-4.1.3/blob/d6fe8fe8299ececc0db4fae9c19cd3babffd28ae/bos/usr/include/paths.h#L36) of AIX 4.13 that has `_PATH_BSHELL`. * [nuttx](https://github.com/apache/nuttx): Couldn't find a `include/paths.h` file. * [NTO/QNX](https://github.com/qnx): Couldn't find a `include/paths.h` file.
1 parent 9a7a284 commit 89a22c6

28 files changed

Lines changed: 104 additions & 0 deletions

File tree

‎libc-test/build/main.rs‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ fn test_apple(t: &Target) {
200200
"os/lock.h",
201201
"os/signpost.h",
202202
"os/os_sync_wait_on_address.h",
203+
"paths.h",
203204
"poll.h",
204205
"pthread.h",
205206
"pthread_spis.h",
@@ -473,6 +474,7 @@ fn test_openbsd(t: &Target) {
473474
"sys/shm.h",
474475
"sys/param.h",
475476
"sys/auxv.h",
477+
"paths.h",
476478
);
477479

478480
cfg.rename_type(|ty| match ty {
@@ -574,6 +576,7 @@ fn test_cygwin(t: &Target) {
574576
"net/if.h",
575577
"netdb.h",
576578
"netinet/tcp.h",
579+
"paths.h",
577580
"poll.h",
578581
"pthread.h",
579582
"pty.h",
@@ -875,6 +878,7 @@ fn test_redox(t: &Target) {
875878
"netinet/in.h",
876879
"netinet/ip.h",
877880
"netinet/tcp.h",
881+
"paths.h",
878882
"poll.h",
879883
"pwd.h",
880884
"semaphore.h",
@@ -1303,6 +1307,7 @@ fn test_netbsd(t: &Target) {
13031307
"iconv.h",
13041308
"utmp.h",
13051309
"utmpx.h",
1310+
"paths.h",
13061311
);
13071312

13081313
cfg.rename_type(move |ty| {
@@ -1546,6 +1551,7 @@ fn test_dragonflybsd(t: &Target) {
15461551
"netinet/ip.h",
15471552
"netinet/tcp.h",
15481553
"netinet/udp.h",
1554+
"paths.h",
15491555
"poll.h",
15501556
"pthread.h",
15511557
"pthread_np.h",
@@ -2077,6 +2083,7 @@ fn test_android(t: &Target) {
20772083
// generate the error 'Your time_t is already 64-bit'
20782084
(t.p32(), "time64.h"),
20792085
(x86, "sys/reg.h"),
2086+
"paths.h",
20802087
);
20812088

20822089
// Include linux headers at the end:
@@ -2560,6 +2567,7 @@ fn test_freebsd(t: &Target) {
25602567
"netinet/tcp.h",
25612568
"netinet/udp.h",
25622569
"netinet6/in6_var.h",
2570+
"paths.h",
25632571
"poll.h",
25642572
"pthread.h",
25652573
"pthread_np.h",
@@ -3247,6 +3255,7 @@ fn test_emscripten(t: &Target) {
32473255
"utmp.h",
32483256
"utmpx.h",
32493257
"wchar.h",
3258+
"paths.h",
32503259
);
32513260

32523261
cfg.rename_struct_ty(move |ty| {
@@ -4106,6 +4115,7 @@ fn test_linux(t: &Target) {
41064115
// https://www.openwall.com/lists/musl/2015/04/09/3
41074116
// <execinfo.h> is not present on uclibc.
41084117
(!(musl || uclibc), "execinfo.h"),
4118+
"paths.h",
41094119
);
41104120

41114121
// Include linux headers at the end:
@@ -5384,6 +5394,7 @@ fn test_haiku(t: &Target) {
53845394
"netinet6/in6.h",
53855395
"nl_types.h",
53865396
"null.h",
5397+
"paths.h",
53875398
"poll.h",
53885399
"pthread.h",
53895400
"pwd.h",

‎libc-test/semver/android.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3175,6 +3175,8 @@ X_OK
31753175
_IOFBF
31763176
_IOLBF
31773177
_IONBF
3178+
_PATH_BSHELL
3179+
_PATH_DEFPATH
31783180
_PC_2_SYMLINKS
31793181
_PC_ALLOC_SIZE_MIN
31803182
_PC_ASYNC_IO

‎libc-test/semver/apple.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,6 +1631,8 @@ _NSGetArgc
16311631
_NSGetArgv
16321632
_NSGetEnviron
16331633
_NSGetProgname
1634+
_PATH_BSHELL
1635+
_PATH_DEFPATH
16341636
_PC_2_SYMLINKS
16351637
_PC_ALLOC_SIZE_MIN
16361638
_PC_ASYNC_IO

‎libc-test/semver/cygwin.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,8 @@ WINDOWS_SEND
472472
XTABS
473473
_CS_PATH
474474
_IONBF
475+
_PATH_BSHELL
476+
_PATH_DEFPATH
475477
_PC_2_SYMLINKS
476478
_PC_ALLOC_SIZE_MIN
477479
_PC_ASYNC_IO

‎libc-test/semver/dragonfly.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,8 @@ _CS_PATH
11751175
_IOFBF
11761176
_IOLBF
11771177
_IONBF
1178+
_PATH_BSHELL
1179+
_PATH_DEFPATH
11781180
_PC_2_SYMLINKS
11791181
_PC_ACL_EXTENDED
11801182
_PC_ACL_PATH_MAX

‎libc-test/semver/espidf.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ SIGSEGV
3232
SIGTERM
3333
SOL_SOCKET
3434
SOMAXCONN
35+
_PATH_BSHELL
3536
__errno
3637
cmsghdr
3738
dirent

‎libc-test/semver/freebsd.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,6 +1770,8 @@ _IOR
17701770
_IOW
17711771
_IOWINT
17721772
_IOWR
1773+
_PATH_BSHELL
1774+
_PATH_DEFPATH
17731775
_PC_ACL_EXTENDED
17741776
_PC_ACL_NFS4
17751777
_PC_ACL_PATH_MAX

‎libc-test/semver/linux.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3873,6 +3873,8 @@ _IONBF
38733873
_IOR
38743874
_IOW
38753875
_IOWR
3876+
_PATH_BSHELL
3877+
_PATH_DEFPATH
38763878
_PC_2_SYMLINKS
38773879
_PC_ALLOC_SIZE_MIN
38783880
_PC_ASYNC_IO

‎libc-test/semver/netbsd.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,8 @@ _IONBF
11321132
_IOR
11331133
_IOW
11341134
_IOWR
1135+
_PATH_BSHELL
1136+
_PATH_DEFPATH
11351137
_PC_2_SYMLINKS
11361138
_PC_ACL_EXTENDED
11371139
_PC_FILESIZEBITS

‎libc-test/semver/openbsd.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,8 @@ _IOR
989989
_IOW
990990
_IOWR
991991
_MAX_PAGE_SHIFT
992+
_PATH_BSHELL
993+
_PATH_DEFPATH
992994
_PC_2_SYMLINKS
993995
_PC_ALLOC_SIZE_MIN
994996
_PC_ASYNC_IO

0 commit comments

Comments
 (0)