@@ -62,38 +62,49 @@ pub use crate::signal::Signal;
6262/// If we want to expose this in public APIs, we should encapsulate the
6363/// `linux_raw_sys` type.
6464#[ cfg( linux_raw) ]
65- pub type Sigaction = linux_raw_sys:: general:: kernel_sigaction ;
65+ pub use linux_raw_sys:: general:: kernel_sigaction as KernelSigaction ;
6666
6767/// `stack_t`
6868///
6969/// If we want to expose this in public APIs, we should encapsulate the
7070/// `linux_raw_sys` type.
7171#[ cfg( linux_raw) ]
72- pub type Stack = linux_raw_sys:: general:: stack_t ;
72+ pub use linux_raw_sys:: general:: stack_t as Stack ;
7373
74- /// `sigset_t`.
74+ /// `sigset_t`
7575///
76- /// Undefined behavior could happen in some functions if `Sigset` ever
77- /// contains signal numbers in the range from
78- /// `linux_raw_sys::general::SIGRTMIN` to what the libc thinks `SIGRTMIN` is.
79- /// Unless you are implementing the libc. Which you may indeed be doing, if
80- /// you're reading this.
76+ /// Undefined behavior could happen in some functions if `SigSet` ever
77+ /// contains signal numbers in the range from `KERNEL_SIGRTMIN` to the libc
78+ /// `SIGRTMIN`. Unless you are implementing the libc. Which you may indeed be
79+ /// doing, if you're reading this.
8180///
8281/// If we want to expose this in public APIs, we should encapsulate the
8382/// `linux_raw_sys` type.
8483#[ cfg( linux_raw) ]
85- pub type Sigset = linux_raw_sys:: general:: kernel_sigset_t ;
84+ pub use linux_raw_sys:: general:: sigset_t as SigSet ;
85+
86+ /// `kernel_sigset_t`.
87+ ///
88+ /// Undefined behavior could happen in some functions if `KernelSigSet` ever
89+ /// contains signal numbers in the range from `KERNEL_SIGRTMIN` to the libc
90+ /// `SIGRTMIN`. Unless you are implementing the libc. Which you may indeed be
91+ /// doing, if you're reading this.
92+ ///
93+ /// If we want to expose this in public APIs, we should encapsulate the
94+ /// `linux_raw_sys` type.
95+ #[ cfg( linux_raw) ]
96+ pub use linux_raw_sys:: general:: kernel_sigset_t as KernelSigSet ;
8697
8798/// `siginfo_t`
8899///
89100/// If we want to expose this in public APIs, we should encapsulate the
90101/// `linux_raw_sys` type.
91102#[ cfg( linux_raw) ]
92- pub type Siginfo = linux_raw_sys:: general:: siginfo_t ;
103+ pub use linux_raw_sys:: general:: siginfo_t as Siginfo ;
93104
94105pub use crate :: timespec:: { Nsecs , Secs , Timespec } ;
95106
96- /// `SIG_*` constants for use with [`sigprocmask `].
107+ /// `SIG_*` constants for use with [`kernel_sigprocmask `].
97108#[ cfg( linux_raw) ]
98109#[ repr( u32 ) ]
99110pub enum How {
@@ -341,8 +352,8 @@ pub use backend::runtime::tls::StartupTlsInfo;
341352/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/fork.html
342353/// [Linux]: https://man7.org/linux/man-pages/man2/fork.2.html
343354/// [async-signal-safe]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html#tag_15_04_03
344- pub unsafe fn fork ( ) -> io:: Result < Fork > {
345- backend:: runtime:: syscalls:: fork ( )
355+ pub unsafe fn kernel_fork ( ) -> io:: Result < Fork > {
356+ backend:: runtime:: syscalls:: kernel_fork ( )
346357}
347358
348359/// Regular Unix `fork` doesn't tell the child its own PID because it assumes
@@ -423,8 +434,11 @@ pub unsafe fn execve(path: &CStr, argv: *const *const u8, envp: *const *const u8
423434/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/sigaction.html
424435/// [Linux]: https://man7.org/linux/man-pages/man2/sigaction.2.html
425436#[ inline]
426- pub unsafe fn sigaction ( signal : Signal , new : Option < Sigaction > ) -> io:: Result < Sigaction > {
427- backend:: runtime:: syscalls:: sigaction ( signal, new)
437+ pub unsafe fn kernel_sigaction (
438+ signal : Signal ,
439+ new : Option < KernelSigaction > ,
440+ ) -> io:: Result < KernelSigaction > {
441+ backend:: runtime:: syscalls:: kernel_sigaction ( signal, new)
428442}
429443
430444/// `sigaltstack(new, old)`—Modify or query a signal stack.
@@ -479,8 +493,8 @@ pub unsafe fn tkill(tid: Pid, sig: Signal) -> io::Result<()> {
479493#[ inline]
480494#[ doc( alias = "pthread_sigmask" ) ]
481495#[ doc( alias = "rt_sigprocmask" ) ]
482- pub unsafe fn sigprocmask ( how : How , set : Option < & Sigset > ) -> io:: Result < Sigset > {
483- backend:: runtime:: syscalls:: sigprocmask ( how, set)
496+ pub unsafe fn kernel_sigprocmask ( how : How , set : Option < & KernelSigSet > ) -> io:: Result < KernelSigSet > {
497+ backend:: runtime:: syscalls:: kernel_sigprocmask ( how, set)
484498}
485499
486500/// `sigpending()`—Query the pending signals.
@@ -493,7 +507,7 @@ pub unsafe fn sigprocmask(how: How, set: Option<&Sigset>) -> io::Result<Sigset>
493507///
494508/// [Linux `sigpending`]: https://man7.org/linux/man-pages/man2/sigpending.2.html
495509#[ inline]
496- pub fn sigpending ( ) -> Sigset {
510+ pub fn sigpending ( ) -> SigSet {
497511 backend:: runtime:: syscalls:: sigpending ( )
498512}
499513
@@ -507,7 +521,7 @@ pub fn sigpending() -> Sigset {
507521///
508522/// [Linux `sigsuspend`]: https://man7.org/linux/man-pages/man2/sigsuspend.2.html
509523#[ inline]
510- pub fn sigsuspend ( set : & Sigset ) -> io:: Result < ( ) > {
524+ pub fn sigsuspend ( set : & SigSet ) -> io:: Result < ( ) > {
511525 backend:: runtime:: syscalls:: sigsuspend ( set)
512526}
513527
@@ -524,7 +538,7 @@ pub fn sigsuspend(set: &Sigset) -> io::Result<()> {
524538///
525539/// [Linux]: https://man7.org/linux/man-pages/man3/sigwait.3.html
526540#[ inline]
527- pub unsafe fn sigwait ( set : & Sigset ) -> io:: Result < Signal > {
541+ pub unsafe fn sigwait ( set : & SigSet ) -> io:: Result < Signal > {
528542 backend:: runtime:: syscalls:: sigwait ( set)
529543}
530544
@@ -541,7 +555,7 @@ pub unsafe fn sigwait(set: &Sigset) -> io::Result<Signal> {
541555///
542556/// [Linux]: https://man7.org/linux/man-pages/man2/sigwaitinfo.2.html
543557#[ inline]
544- pub unsafe fn sigwaitinfo ( set : & Sigset ) -> io:: Result < Siginfo > {
558+ pub unsafe fn sigwaitinfo ( set : & SigSet ) -> io:: Result < Siginfo > {
545559 backend:: runtime:: syscalls:: sigwaitinfo ( set)
546560}
547561
@@ -558,7 +572,7 @@ pub unsafe fn sigwaitinfo(set: &Sigset) -> io::Result<Siginfo> {
558572///
559573/// [Linux]: https://man7.org/linux/man-pages/man2/sigtimedwait.2.html
560574#[ inline]
561- pub unsafe fn sigtimedwait ( set : & Sigset , timeout : Option < Timespec > ) -> io:: Result < Siginfo > {
575+ pub unsafe fn sigtimedwait ( set : & SigSet , timeout : Option < Timespec > ) -> io:: Result < Siginfo > {
562576 backend:: runtime:: syscalls:: sigtimedwait ( set, timeout)
563577}
564578
@@ -598,8 +612,8 @@ pub fn linux_secure() -> bool {
598612/// (perhaps because you yourself are implementing a libc).
599613#[ cfg( linux_raw) ]
600614#[ inline]
601- pub unsafe fn brk ( addr : * mut c_void ) -> io:: Result < * mut c_void > {
602- backend:: runtime:: syscalls:: brk ( addr)
615+ pub unsafe fn kernel_brk ( addr : * mut c_void ) -> io:: Result < * mut c_void > {
616+ backend:: runtime:: syscalls:: kernel_brk ( addr)
603617}
604618
605619/// `SIGRTMIN`—The start of the raw OS “real-time” signal range.
@@ -609,9 +623,9 @@ pub unsafe fn brk(addr: *mut c_void) -> io::Result<*mut c_void> {
609623/// won't share a process with a libc (perhaps because you yourself are
610624/// implementing a libc).
611625///
612- /// See [`sigrt`] for a convenient way to construct `SIGRTMIN + n` values.
626+ /// See [`sigrt`] for a convenient way to construct `KERNEL_SIGRTMIN + n` values.
613627#[ cfg( linux_raw) ]
614- pub const SIGRTMIN : i32 = linux_raw_sys:: general:: SIGRTMIN as i32 ;
628+ pub const KERNEL_SIGRTMIN : i32 = linux_raw_sys:: general:: SIGRTMIN as i32 ;
615629
616630/// `SIGRTMAX`—The last of the raw OS “real-time” signal range.
617631///
@@ -620,7 +634,7 @@ pub const SIGRTMIN: i32 = linux_raw_sys::general::SIGRTMIN as i32;
620634/// won't share a process with a libc (perhaps because you yourself are
621635/// implementing a libc).
622636#[ cfg( linux_raw) ]
623- pub const SIGRTMAX : i32 = {
637+ pub const KERNEL_SIGRTMAX : i32 = {
624638 // Use the actual `SIGRTMAX` value on platforms which define it.
625639 #[ cfg( not( any(
626640 target_arch = "arm" ,
@@ -644,17 +658,17 @@ pub const SIGRTMAX: i32 = {
644658 }
645659} ;
646660
647- /// Return a [`Signal`] corresponding to `SIGRTMIN + n`.
661+ /// Return a [`Signal`] corresponding to `KERNEL_SIGRTMIN + n`.
648662///
649- /// This is similar to [`Signal::rt`], but uses the raw OS `SIGRTMIN ` value
663+ /// This is similar to [`Signal::rt`], but uses the `KERNEL_SIGRTMIN ` value
650664/// instead of the libc `SIGRTMIN` value. Don't use this unless you know your
651665/// code won't share a process with a libc (perhaps because you yourself are
652666/// implementing a libc).
653667#[ cfg( linux_raw) ]
654668#[ doc( alias = "SIGRTMIN" ) ]
655- pub const fn sigrt ( n : i32 ) -> Option < Signal > {
656- let sig = SIGRTMIN . wrapping_add ( n) ;
657- if sig >= SIGRTMIN && sig <= SIGRTMAX {
669+ pub const fn kernel_sigrt ( n : i32 ) -> Option < Signal > {
670+ let sig = KERNEL_SIGRTMIN . wrapping_add ( n) ;
671+ if sig >= KERNEL_SIGRTMIN && sig <= KERNEL_SIGRTMAX {
658672 // SAFETY: We've checked that `sig` is in the expected range. It could
659673 // still conflict with libc's reserved values, however users of the
660674 // `runtime` module here must already know that there's no other libc
0 commit comments