import { dlopen, ptr } from "bun:ffi"; var lazyMkfifo: any; export function mkfifo(path: string, permissions: number = 0o666): void { if (!lazyMkfifo) { const suffix = process.platform === "darwin" ? "dylib" : "so.6"; lazyMkfifo = dlopen(`libc.${suffix}`, { mkfifo: { args: ["ptr", "i32"], returns: "i32", }, }).symbols.mkfifo; } const buf = new Uint8Array(Buffer.byteLength(path) + 1); new TextEncoder().encodeInto(path, buf); const rc = lazyMkfifo(ptr(buf), permissions); if (rc < 0) { throw new Error(`mkfifo failed`); } } dex : bun
Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/serve.test.ts (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-06-22Fix bug with exceptions inside EventTargetGravatar Jarred Sumner 11-137/+413
2022-06-22Add a way to schedule microtasks from C++Gravatar Jarred Sumner 5-35/+77
2022-06-22Update javascript.zigGravatar Jarred Sumner 1-13/+152
2022-06-22Clean up perf hooks a littleGravatar Jarred Sumner 1-9/+21
2022-06-22use JSValue for `bun test`Gravatar Jarred Sumner 1-13/+19