mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
* signal events * simple tests * ignore SIGSTOP * better tests * use `EventEmitter` * use `Bun__getDefaultGlobal` * progress * don't use 'Bun__getDefaultGlobal` * fix tests * remove signals from map * update tests * don't overwrite event emitter methods * avoid two lookups * use `std::once` * releaseEarly() * Remove signal handler after use * Update call-raise.js * Create process-signal-handler.fixture.js * Don't register duplicates * Add missing lock * another test * update test * revert some changes --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
16 lines
334 B
JavaScript
16 lines
334 B
JavaScript
import { dlopen } from "bun:ffi";
|
|
|
|
var lazyRaise;
|
|
export function raise(signal) {
|
|
if (!lazyRaise) {
|
|
const suffix = process.platform === "darwin" ? "dylib" : "so.6";
|
|
lazyRaise = dlopen(`libc.${suffix}`, {
|
|
raise: {
|
|
args: ["int"],
|
|
returns: "int",
|
|
},
|
|
}).symbols.raise;
|
|
}
|
|
lazyRaise(signal);
|
|
}
|