1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:07:45 +00:00

LibC: Make prctl() a varargs function

This commit is contained in:
Tim Schumacher 2022-03-28 21:35:23 +02:00 committed by Brian Gianforcaro
parent d9d299f884
commit aa7b6852ce
2 changed files with 10 additions and 2 deletions

View file

@ -12,8 +12,16 @@
extern "C" { extern "C" {
int prctl(int option, uintptr_t arg1, uintptr_t arg2) int prctl(int option, ...)
{ {
va_list args;
va_start(args, option);
uintptr_t arg1 = va_arg(args, uintptr_t);
uintptr_t arg2 = va_arg(args, uintptr_t);
va_end(args);
int rc = syscall(SC_prctl, option, arg1, arg2); int rc = syscall(SC_prctl, option, arg1, arg2);
__RETURN_WITH_ERRNO(rc, rc, -1); __RETURN_WITH_ERRNO(rc, rc, -1);
} }

View file

@ -12,6 +12,6 @@
__BEGIN_DECLS __BEGIN_DECLS
int prctl(int option, uintptr_t arg1, uintptr_t arg2); int prctl(int option, ...);
__END_DECLS __END_DECLS