generated from napi-rs/package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
43 lines (41 loc) · 1.71 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
/**
* Performs the execvp system call with the given file and arguments, replacing
* the current process image with the new one.
*
* This function does not return if successful, as the current process is
* replaced by the new one. An error may be thrown, with an error message
* containing the error code returned by execvp.
*
* Note that the close-on-exec flag should be cleared for the process's file
* descriptors. Otherwise, they will be closed automatically when the new
* process is executed, which will likely make it fail. Use the
* `doNotCloseOnExit` function to clear the flag for a file descriptor.
*
* @example
* import { execvp } from '@alphahydrae/exec';
* execvp('ls', ['/bin/ls', '-l', '.']);
*
* @param {string} file The file to execute. If not a path, the PATH environment
* variable is searched.
* @param {string[]} args The arguments to pass to the new process. Note that
* the first argument, by convention, should point to
* the filename associated with the file being executed.
* @throws {Error} If the execvp system call fails.
*/
export declare function execvp(file: string, args: Array<string>): void
/**
* Clears the close-on-exec flag for the given file descriptor, preventing it
* from being closed automatically when a new process is executed with the exec
* family of functions.
*
* @example
* doNotCloseOnExit(process.stdout.fd);
*
* @param {number} file The file descriptor to close (e.g. `process.stdout.fd`).
* @returns {undefined}
* @throws {Error} If the fcntl system call fails.
*/
export declare function doNotCloseOnExit(fd: number): void