* Florian Weimer <fweimer@xxxxxxxxxx>, 2021-04-12, 08:17:
SYNOPSIS
#include <asm/prctl.h> /* Definition of ARCH_* constants */
#include <sys/syscall.h> /* Definition of SYS_* constants */
#include <unistd.h>
int syscall(SYS_arch_prctl, int code, unsigned long addr);
int syscall(SYS_arch_prctl, int code, unsigned long *addr);
Note: glibc provides no wrapper for arch_prctl(), necessitating
the use of syscall(2).
Without something like this, the reader may be puzzled at the use of
syscall().
What do you think?
Would it be possible to use real C syntax?
Seconded.
int code;
unsigned long addr;
int result;
result = syscall (SYS_arch_prctl, code, addr);
result = syscall (SYS_arch_prctl, code, &addr);
Or perhaps omit the result variable:
int code;
unsigned long addr;
syscall (SYS_arch_prctl, code, addr);
Or, more succinctly, put the types in comments:
syscall(SYS_arch_prctl, /* int */ code, /* unsigned long */ addr);
--
Jakub Wilk