@k13engineering/po6-ioctl
v0.0.2
Published
posix ioctl
Readme
node-po6-ioctl
A lightweight Node.js wrapper for the ioctl system call using NAPI.
Installation
npm install @k13engineering/po6-ioctlUsage
import { ioctl } from '@k13engineering/po6-ioctl';
const result = ioctl({
fd: fileDescriptor,
request: 0x12345678n, // ioctl request code
arg: buffer // bigint or Uint8Array
});
if (result.errno !== undefined) {
console.error('ioctl failed:', result.errno);
} else {
console.log('ioctl succeeded:', result.ret);
}API
ioctl({ fd, request, arg })
fd(number): File descriptorrequest(bigint): ioctl request codearg(bigint | Uint8Array): Argument to pass to ioctl
Returns an object with either:
{ errno: number, ret: undefined }on error{ errno: undefined, ret: bigint }on success
License
See LICENSE file.
