Files
bare-operating-system/packages/bare-os-booter/lib/bare-os-posix-signals.js
T
Raven Scott 985eadfda3 Align the booter and docs with the kernel POSIX and stack-hardening roadmap: refresh
vendored Bare bundles and seeder parity; tighten the no-`node:` verifier and host-vs-image
docs; expand syscall/proc JSON with POSIX XSH-style ops, errno hints, signals, and schema
updates; add simulated FD table hooks, pathconf/getconf coverage, IPC message-queue surface,
swarm/protomux pool metrics and HyperDHT stats env; extend systemctl verbs, cron TZ-aware
matching, Pear updater and corestore snapshot hints, WASM instantiate behind a gate, and
runBin default timeout merging with caller abort options.

Bump BARE_OS_CTX_API_VERSION to 1.34.0 and BARE_OS_POSIX_PROFILE_VERSION to 1.0.1; sync
declared profile, compliance matrix, handbook, example syscalls JSON, CHANGELOG, and
generated ctx client helper; extend bare-os-ctx.d.ts for new ctx members.
2026-04-04 22:39:33 -04:00

57 lines
947 B
JavaScript

/**
* POSIX.1 Issue 7 signal names accepted by synthetic `kill` / `ctx.bareOsSendSignal`
* (delivery is logical; many only update guest state without host semantics).
*/
export const BARE_OS_POSIX_SIGNAL_NAMES = Object.freeze([
'HUP',
'INT',
'QUIT',
'ILL',
'TRAP',
'ABRT',
'BUS',
'FPE',
'KILL',
'USR1',
'SEGV',
'USR2',
'PIPE',
'ALRM',
'TERM',
'STKFLT',
'CHLD',
'CONT',
'STOP',
'TSTP',
'TTIN',
'TTOU',
'URG',
'XCPU',
'XFSZ',
'VTALRM',
'PROF',
'WINCH',
'IO',
'SYS'
])
/** @type {ReadonlySet<string>} */
const SET = new Set(BARE_OS_POSIX_SIGNAL_NAMES)
/**
* @param {string} signal
*/
export function bareOsNormalizeSignalName(signal) {
return String(signal || 'TERM')
.replace(/^SIG/i, '')
.toUpperCase()
}
/**
* @param {string} signal
*/
export function bareOsIsPosixSignalName(signal) {
const s = bareOsNormalizeSignalName(signal)
return SET.has(s) || s === '0'
}