Skip to content

Commit ac402e7

Browse files
committed
util: Conditionalize some syscalls in syscall name table
Put these in `#ifdef` as they are newer syscalls that might not be defined on all kernels: __NR_pkey_alloc __NR_pkey_free __NR_pkey_mprotect __NR_preadv2 __NR_pwritev2 Thanks to jamesob for reporting.
1 parent 64085b3 commit ac402e7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/util/syscall_sandbox.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,23 @@ const std::map<uint32_t, std::string> LINUX_SYSCALLS{
272272
{__NR_pipe, "pipe"},
273273
{__NR_pipe2, "pipe2"},
274274
{__NR_pivot_root, "pivot_root"},
275+
#ifdef __NR_pkey_alloc
275276
{__NR_pkey_alloc, "pkey_alloc"},
277+
#endif
278+
#ifdef __NR_pkey_free
276279
{__NR_pkey_free, "pkey_free"},
280+
#endif
281+
#ifdef __NR_pkey_mprotect
277282
{__NR_pkey_mprotect, "pkey_mprotect"},
283+
#endif
278284
{__NR_poll, "poll"},
279285
{__NR_ppoll, "ppoll"},
280286
{__NR_prctl, "prctl"},
281287
{__NR_pread64, "pread64"},
282288
{__NR_preadv, "preadv"},
289+
#ifdef __NR_preadv2
283290
{__NR_preadv2, "preadv2"},
291+
#endif
284292
{__NR_prlimit64, "prlimit64"},
285293
{__NR_process_vm_readv, "process_vm_readv"},
286294
{__NR_process_vm_writev, "process_vm_writev"},
@@ -289,7 +297,9 @@ const std::map<uint32_t, std::string> LINUX_SYSCALLS{
289297
{__NR_putpmsg, "putpmsg"},
290298
{__NR_pwrite64, "pwrite64"},
291299
{__NR_pwritev, "pwritev"},
300+
#ifdef __NR_pwritev2
292301
{__NR_pwritev2, "pwritev2"},
302+
#endif
293303
{__NR_query_module, "query_module"},
294304
{__NR_quotactl, "quotactl"},
295305
{__NR_read, "read"},

0 commit comments

Comments
 (0)