Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/uucore/src/lib/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ pub mod selinux;
target_os = "android",
target_os = "cygwin",
target_os = "freebsd",
target_os = "haiku",
target_os = "hurd",
target_os = "illumos",
target_os = "linux",
Expand Down
76 changes: 76 additions & 0 deletions src/uucore/src/lib/features/signals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,82 @@ pub static ALL_SIGNALS: [&str; 32] = [
"XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "INFO", "USR1", "USR2",
];

/*

The following signals are defined in Haiku:
// https://github.com/haiku/haiku/blob/master/headers/posix/signal.h

SIGHUP 1 hangup -- tty is gone!
SIGINT 2 interrupt
SIGQUIT 3 `quit' special character typed in tty
SIGILL 4 illegal instruction
SIGCHLD 5 child process exited
SIGABRT 6 abort() called, dont' catch
SIGPIPE 7 write to a pipe w/no readers
SIGFPE 8 floating point exception
SIGKILL 9 kill a team (not catchable)
SIGSTOP 10 suspend a thread (not catchable)
SIGSEGV 11 segmentation violation (read: invalid pointer)
SIGCONT 12 continue execution if suspended
SIGTSTP 13 `stop' special character typed in tty
SIGALRM 14 an alarm has gone off (see alarm())
SIGTERM 15 termination requested
SIGTTIN 16 read of tty from bg process
SIGTTOU 17 write to tty from bg process
SIGUSR1 18 app defined signal 1
SIGUSR2 19 app defined signal 2
SIGWINCH 20 tty window size changed
SIGKILLTHR 21 be specific: kill just the thread, not team
SIGTRAP 22 Trace/breakpoint trap
SIGPOLL 23 Pollable event
SIGPROF 24 Profiling timer expired
SIGSYS 25 Bad system call
SIGURG 26 High bandwidth data is available at socket
SIGVTALRM 27 Virtual timer expired
SIGXCPU 28 CPU time limit exceeded
SIGXFSZ 29 File size limit exceeded
SIGBUS 30 access to undefined portion of a memory object
SIGRESERVED1 31 reserved for future use
SIGRESERVED2 32 reserved for future use
*/

#[cfg(target_os = "haiku")]
pub static ALL_SIGNALS: [&str; 33] = [
"EXIT",
"HUP",
"INT",
"QUIT",
"ILL",
"CHLD",
"ABRT",
"PIPE",
"FPE",
"KILL",
"STOP",
"SEGV",
"CONT",
"TSTP",
"ALRM",
"TERM",
"TTIN",
"TTOU",
"USR1",
"USR2",
"WINCH",
"KILLTHR",
"TRAP",
"POLL",
"PROF",
"SYS",
"URG",
"VTALRM",
"XCPU",
"XFSZ",
"BUS",
"RESERVED1",
"RESERVED2",
];

/*

The following signals are defined in GNU/Hurd:
Expand Down
1 change: 1 addition & 0 deletions src/uucore/src/lib/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ pub use crate::features::safe_traversal;
target_os = "android",
target_os = "cygwin",
target_os = "freebsd",
target_os = "haiku",
target_os = "hurd",
target_os = "illumos",
target_os = "linux",
Expand Down
4 changes: 2 additions & 2 deletions src/uucore_procs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn main(args: TokenStream, stream: TokenStream) -> TokenStream {
// Initialize SIGPIPE state capture at process startup (Unix only).
// This must be at module level to set up the .init_array static that runs
// before main() to capture whether SIGPIPE was ignored by the parent process.
#[cfg(all(#signals, unix, not(any(target_os = "fuchsia", target_os = "haiku"))))]
#[cfg(all(#signals, unix, not(target_os = "fuchsia")))]
uucore::init_startup_state_capture!();

pub fn uumain(args: impl uucore::Args) -> i32 {
Expand All @@ -43,7 +43,7 @@ pub fn main(args: TokenStream, stream: TokenStream) -> TokenStream {
// The Rust runtime ignores SIGPIPE, but we need to respect the parent's
// signal disposition for proper pipeline behavior (GNU compatibility).
// needed even for true --version
#[cfg(all(unix, not(any(target_os = "fuchsia", target_os = "haiku"))))]
#[cfg(all(unix, not(target_os = "fuchsia")))]
if !uucore::signals::sigpipe_was_ignored() {
let _ = uucore::signals::enable_pipe_errors();
}
Expand Down
Loading