Merge branch 'paths-h' into 'master'

Add paths.h for Fish

See merge request redox-os/relibc!687
This commit is contained in:
Jeremy Soller
2025-08-11 14:14:58 -06:00
6 changed files with 66 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
#ifndef _RELIBC_PATHS_H
#define _RELIBC_PATHS_H
#define _PATH_BSHELL "/bin/sh"
#endif
+5
View File
@@ -0,0 +1,5 @@
include_guard = "_RELIBC_PATHS_H"
language = "C"
style = "Type"
no_includes = true
cpp_compat = true
+29
View File
@@ -0,0 +1,29 @@
//! Linux specific constants for paths.h.
//! Entirely borrowed from musl as there isn't a list of what to include.
pub const _PATH_DEFPATH: &str = "/usr/local/bin:/bin:/usr/bin";
pub const _PATH_STDPATH: &str = "/bin:/usr/bin:/sbin:/usr/sbin";
pub const _PATH_BSHELL: &str = "/bin/sh";
pub const _PATH_CONSOLE: &str = "/dev/console";
pub const _PATH_DEVNULL: &str = "/dev/null";
pub const _PATH_KLOG: &str = "/proc/kmsg";
pub const _PATH_LASTLOG: &str = "/var/log/lastlog";
pub const _PATH_MAILDIR: &str = "/var/mail";
pub const _PATH_MAN: &str = "/usr/share/man";
pub const _PATH_MNTTAB: &str = "/etc/fstab";
pub const _PATH_NOLOGIN: &str = "/etc/nologin";
pub const _PATH_SENDMAIL: &str = "/usr/sbin/sendmail";
pub const _PATH_SHADOW: &str = "/etc/shadow";
pub const _PATH_SHELLS: &str = "/etc/shells";
pub const _PATH_TTY: &str = "/dev/tty";
pub const _PATH_UTMP: &str = "/var/run/utmp";
pub const _PATH_WTMP: &str = "/var/log/wtmp";
pub const _PATH_VI: &str = "/usr/bin/vi";
// Trailing backslash intentional as these are dir paths.
pub const _PATH_DEV: &str = "/dev/";
pub const _PATH_TMP: &str = "/tmp/";
pub const _PATH_VARDB: &str = "/var/lib/misc/";
pub const _PATH_VARRUN: &str = "/var/run/";
pub const _PATH_VARTMP: &str = "/var/tmp/";
+11
View File
@@ -0,0 +1,11 @@
//! Implementation specific, non-standard path aliases
#[cfg(target_os = "linux")]
#[path = "linux.rs"]
mod sys;
#[cfg(target_os = "redox")]
#[path = "redox.rs"]
mod sys;
pub use sys::*;
+13
View File
@@ -0,0 +1,13 @@
//! Redox specific constants for paths.h.
// NOTE: Cross check that new entries correspond to files on Redox before adding.
pub const _PATH_BSHELL: &str = "/bin/sh";
pub const _PATH_DEVNULL: &str = "/dev/null";
pub const _PATH_MAN: &str = "/usr/share/man";
pub const _PATH_TTY: &str = "/dev/tty";
// Trailing backslash intentional as these are dir paths.
pub const _PATH_DEV: &str = "/dev/";
pub const _PATH_TMP: &str = "/tmp/";
pub const _PATH_VARTMP: &str = "/var/tmp/";
+2
View File
@@ -47,6 +47,8 @@ pub mod netinet_in;
pub mod netinet_ip;
pub mod netinet_tcp;
// TODO: nl_types.h
// TODO: Remove C header paths.h when cbindgen can export C/Rust strs
// pub mod paths;
pub mod poll;
pub mod pthread;
pub mod pty;