ladybird/Userland/Libraries/LibC/sys/prctl.cpp

29 lines
510 B
C++
Raw Normal View History

/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <sys/prctl.h>
#include <syscall.h>
extern "C" {
2022-03-28 21:35:23 +02:00
int prctl(int option, ...)
{
2022-03-28 21:35:23 +02:00
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);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
}