syscall-napi 0.0.8 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,267 +0,0 @@
1
- export default {
2
- __NR_io_setup: 206n,
3
- __NR_io_destroy: 207n,
4
- __NR_io_submit: 209n,
5
- __NR_io_cancel: 210n,
6
- __NR_io_getevents: 208n,
7
- __NR_setxattr: 188n,
8
- __NR_lsetxattr: 189n,
9
- __NR_fsetxattr: 190n,
10
- __NR_getxattr: 191n,
11
- __NR_lgetxattr: 192n,
12
- __NR_fgetxattr: 193n,
13
- __NR_listxattr: 194n,
14
- __NR_llistxattr: 195n,
15
- __NR_flistxattr: 196n,
16
- __NR_removexattr: 197n,
17
- __NR_lremovexattr: 198n,
18
- __NR_fremovexattr: 199n,
19
- __NR_getcwd: 79n,
20
- __NR_lookup_dcookie: 212n,
21
- __NR_eventfd2: 290n,
22
- __NR_epoll_create1: 291n,
23
- __NR_epoll_ctl: 233n,
24
- __NR_epoll_pwait: 281n,
25
- __NR_dup: 32n,
26
- __NR_dup3: 292n,
27
- __NR_inotify_init1: 294n,
28
- __NR_inotify_add_watch: 254n,
29
- __NR_inotify_rm_watch: 255n,
30
- __NR_ioctl: 16n,
31
- __NR_ioprio_set: 251n,
32
- __NR_ioprio_get: 252n,
33
- __NR_flock: 73n,
34
- __NR_mknodat: 259n,
35
- __NR_mkdirat: 258n,
36
- __NR_unlinkat: 263n,
37
- __NR_symlinkat: 266n,
38
- __NR_linkat: 265n,
39
- __NR_renameat: 264n,
40
- __NR_umount2: 166n,
41
- __NR_mount: 165n,
42
- __NR_pivot_root: 155n,
43
- __NR_nfsservctl: 180n,
44
- __NR_fallocate: 285n,
45
- __NR_faccessat: 269n,
46
- __NR_chdir: 80n,
47
- __NR_fchdir: 81n,
48
- __NR_chroot: 161n,
49
- __NR_fchmod: 91n,
50
- __NR_fchmodat: 268n,
51
- __NR_fchownat: 260n,
52
- __NR_fchown: 93n,
53
- __NR_openat: 257n,
54
- __NR_close: 3n,
55
- __NR_vhangup: 153n,
56
- __NR_pipe2: 293n,
57
- __NR_quotactl: 179n,
58
- __NR_getdents64: 217n,
59
- __NR_read: 0n,
60
- __NR_write: 1n,
61
- __NR_readv: 19n,
62
- __NR_writev: 20n,
63
- __NR_pread64: 17n,
64
- __NR_pwrite64: 18n,
65
- __NR_preadv: 295n,
66
- __NR_pwritev: 296n,
67
- __NR_pselect6: 270n,
68
- __NR_ppoll: 271n,
69
- __NR_signalfd4: 289n,
70
- __NR_vmsplice: 278n,
71
- __NR_splice: 275n,
72
- __NR_tee: 276n,
73
- __NR_readlinkat: 267n,
74
- __NR_sync: 162n,
75
- __NR_fsync: 74n,
76
- __NR_fdatasync: 75n,
77
- __NR_sync_file_range: 277n,
78
- __NR_timerfd_create: 283n,
79
- __NR_timerfd_settime: 286n,
80
- __NR_timerfd_gettime: 287n,
81
- __NR_utimensat: 280n,
82
- __NR_acct: 163n,
83
- __NR_capget: 125n,
84
- __NR_capset: 126n,
85
- __NR_personality: 135n,
86
- __NR_exit: 60n,
87
- __NR_exit_group: 231n,
88
- __NR_waitid: 247n,
89
- __NR_set_tid_address: 218n,
90
- __NR_unshare: 272n,
91
- __NR_futex: 202n,
92
- __NR_set_robust_list: 273n,
93
- __NR_get_robust_list: 274n,
94
- __NR_nanosleep: 35n,
95
- __NR_getitimer: 36n,
96
- __NR_setitimer: 38n,
97
- __NR_kexec_load: 246n,
98
- __NR_init_module: 175n,
99
- __NR_delete_module: 176n,
100
- __NR_timer_create: 222n,
101
- __NR_timer_gettime: 224n,
102
- __NR_timer_getoverrun: 225n,
103
- __NR_timer_settime: 223n,
104
- __NR_timer_delete: 226n,
105
- __NR_clock_settime: 227n,
106
- __NR_clock_gettime: 228n,
107
- __NR_clock_getres: 229n,
108
- __NR_clock_nanosleep: 230n,
109
- __NR_syslog: 103n,
110
- __NR_ptrace: 101n,
111
- __NR_sched_setparam: 142n,
112
- __NR_sched_setscheduler: 144n,
113
- __NR_sched_getscheduler: 145n,
114
- __NR_sched_getparam: 143n,
115
- __NR_sched_setaffinity: 203n,
116
- __NR_sched_getaffinity: 204n,
117
- __NR_sched_yield: 24n,
118
- __NR_sched_get_priority_max: 146n,
119
- __NR_sched_get_priority_min: 147n,
120
- __NR_sched_rr_get_interval: 148n,
121
- __NR_restart_syscall: 219n,
122
- __NR_kill: 62n,
123
- __NR_tkill: 200n,
124
- __NR_tgkill: 234n,
125
- __NR_sigaltstack: 131n,
126
- __NR_rt_sigsuspend: 130n,
127
- __NR_rt_sigaction: 13n,
128
- __NR_rt_sigprocmask: 14n,
129
- __NR_rt_sigpending: 127n,
130
- __NR_rt_sigtimedwait: 128n,
131
- __NR_rt_sigqueueinfo: 129n,
132
- __NR_rt_sigreturn: 15n,
133
- __NR_setpriority: 141n,
134
- __NR_getpriority: 140n,
135
- __NR_reboot: 169n,
136
- __NR_setregid: 114n,
137
- __NR_setgid: 106n,
138
- __NR_setreuid: 113n,
139
- __NR_setuid: 105n,
140
- __NR_setresuid: 117n,
141
- __NR_getresuid: 118n,
142
- __NR_setresgid: 119n,
143
- __NR_getresgid: 120n,
144
- __NR_setfsuid: 122n,
145
- __NR_setfsgid: 123n,
146
- __NR_times: 100n,
147
- __NR_setpgid: 109n,
148
- __NR_getpgid: 121n,
149
- __NR_getsid: 124n,
150
- __NR_setsid: 112n,
151
- __NR_getgroups: 115n,
152
- __NR_setgroups: 116n,
153
- __NR_uname: 63n,
154
- __NR_sethostname: 170n,
155
- __NR_setdomainname: 171n,
156
- __NR_getrlimit: 97n,
157
- __NR_setrlimit: 160n,
158
- __NR_getrusage: 98n,
159
- __NR_umask: 95n,
160
- __NR_prctl: 157n,
161
- __NR_getcpu: 309n,
162
- __NR_gettimeofday: 96n,
163
- __NR_settimeofday: 164n,
164
- __NR_adjtimex: 159n,
165
- __NR_getpid: 39n,
166
- __NR_getppid: 110n,
167
- __NR_getuid: 102n,
168
- __NR_geteuid: 107n,
169
- __NR_getgid: 104n,
170
- __NR_getegid: 108n,
171
- __NR_gettid: 186n,
172
- __NR_sysinfo: 99n,
173
- __NR_mq_open: 240n,
174
- __NR_mq_unlink: 241n,
175
- __NR_mq_timedsend: 242n,
176
- __NR_mq_timedreceive: 243n,
177
- __NR_mq_notify: 244n,
178
- __NR_mq_getsetattr: 245n,
179
- __NR_msgget: 68n,
180
- __NR_msgctl: 71n,
181
- __NR_msgrcv: 70n,
182
- __NR_msgsnd: 69n,
183
- __NR_semget: 64n,
184
- __NR_semctl: 66n,
185
- __NR_semtimedop: 220n,
186
- __NR_semop: 65n,
187
- __NR_shmget: 29n,
188
- __NR_shmctl: 31n,
189
- __NR_shmat: 30n,
190
- __NR_shmdt: 67n,
191
- __NR_socket: 41n,
192
- __NR_socketpair: 53n,
193
- __NR_bind: 49n,
194
- __NR_listen: 50n,
195
- __NR_accept: 43n,
196
- __NR_connect: 42n,
197
- __NR_getsockname: 51n,
198
- __NR_getpeername: 52n,
199
- __NR_sendto: 44n,
200
- __NR_recvfrom: 45n,
201
- __NR_setsockopt: 54n,
202
- __NR_getsockopt: 55n,
203
- __NR_shutdown: 48n,
204
- __NR_sendmsg: 46n,
205
- __NR_recvmsg: 47n,
206
- __NR_readahead: 187n,
207
- __NR_brk: 12n,
208
- __NR_munmap: 11n,
209
- __NR_mremap: 25n,
210
- __NR_add_key: 248n,
211
- __NR_request_key: 249n,
212
- __NR_keyctl: 250n,
213
- __NR_clone: 56n,
214
- __NR_execve: 59n,
215
- __NR_swapon: 167n,
216
- __NR_swapoff: 168n,
217
- __NR_mprotect: 10n,
218
- __NR_msync: 26n,
219
- __NR_mlock: 149n,
220
- __NR_munlock: 150n,
221
- __NR_mlockall: 151n,
222
- __NR_munlockall: 152n,
223
- __NR_mincore: 27n,
224
- __NR_madvise: 28n,
225
- __NR_remap_file_pages: 216n,
226
- __NR_mbind: 237n,
227
- __NR_get_mempolicy: 239n,
228
- __NR_set_mempolicy: 238n,
229
- __NR_migrate_pages: 256n,
230
- __NR_move_pages: 279n,
231
- __NR_rt_tgsigqueueinfo: 297n,
232
- __NR_perf_event_open: 298n,
233
- __NR_accept4: 288n,
234
- __NR_recvmmsg: 299n,
235
- __NR_wait4: 61n,
236
- __NR_prlimit64: 302n,
237
- __NR_fanotify_init: 300n,
238
- __NR_fanotify_mark: 301n,
239
- __NR_name_to_handle_at: 303n,
240
- __NR_open_by_handle_at: 304n,
241
- __NR_clock_adjtime: 305n,
242
- __NR_syncfs: 306n,
243
- __NR_setns: 308n,
244
- __NR_sendmmsg: 307n,
245
- __NR_process_vm_readv: 310n,
246
- __NR_process_vm_writev: 311n,
247
- __NR_kcmp: 312n,
248
- __NR_finit_module: 313n,
249
- __NR_sched_setattr: 314n,
250
- __NR_sched_getattr: 315n,
251
- __NR_renameat2: 316n,
252
- __NR_seccomp: 317n,
253
- __NR_getrandom: 318n,
254
- __NR_memfd_create: 319n,
255
- __NR_bpf: 321n,
256
- __NR_execveat: 322n,
257
- __NR_userfaultfd: 323n,
258
- __NR_membarrier: 324n,
259
- __NR_mlock2: 325n,
260
- __NR_copy_file_range: 326n,
261
- __NR_preadv2: 327n,
262
- __NR_pwritev2: 328n,
263
- __NR_pkey_mprotect: 329n,
264
- __NR_pkey_alloc: 330n,
265
- __NR_pkey_free: 331n,
266
- __NR_statx: 332n,
267
- };
package/lib/index.js DELETED
@@ -1,26 +0,0 @@
1
- import constants from "./constants/index.js";
2
-
3
- import { createRequire } from "module";
4
- const require = createRequire(import.meta.url);
5
-
6
- let native;
7
-
8
- try {
9
- native = require("../build/Release/syscall.node");
10
- } catch {
11
- native = require("../build/Debug/syscall.node");
12
- }
13
-
14
- const { syscall_async, syscall_sync } = native;
15
-
16
- const syscall = (...args) => {
17
- return syscall_async(...args);
18
- };
19
- syscall.sync = (...args) => {
20
- return syscall_sync(...args);
21
- };
22
-
23
- export default {
24
- syscall,
25
- ...constants,
26
- };
package/samples/getpid.js DELETED
@@ -1,11 +0,0 @@
1
- import sys from "../lib/index.js";
2
-
3
- process.nextTick(async () => {
4
- try {
5
- const pid = await sys.syscall(sys.__NR_getpid);
6
- console.log(`pid = ${pid}`);
7
- } catch (ex) {
8
- console.error(ex);
9
- process.exitCode = -1;
10
- }
11
- });
package/test/basic.js DELETED
@@ -1,19 +0,0 @@
1
- /* global describe */
2
- /* global it */
3
-
4
- import assert from "assert";
5
- import sys from "../lib/index.js";
6
-
7
- describe("basic", () => {
8
- it("should run getpid() correctly [async]", async () => {
9
- const { errno, ret: pid } = await sys.syscall(sys.__NR_getpid);
10
- assert.equal(errno, 0);
11
- assert.equal(pid, process.pid);
12
- });
13
-
14
- it("should run getpid() correctly [sync]", () => {
15
- const { errno, ret: pid } = sys.syscall.sync(sys.__NR_getpid);
16
- assert.equal(errno, 0);
17
- assert.equal(pid, process.pid);
18
- });
19
- });