mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-01 07:35:02 +03:00
LibC: Add a wrapper for the getrusage syscall
This commit is contained in:
parent
839d3d9f74
commit
8a9a9fac4d
Notes:
sideshowbarker
2024-07-17 18:06:24 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/8a9a9fac4d Pull-request: https://github.com/SerenityOS/serenity/pull/12244 Issue: https://github.com/SerenityOS/serenity/issues/1140 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/bgianfo ✅ Reviewed-by: https://github.com/linusg
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, Lucas Chollet <lucas.chollet@free.fr>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
@ -7,21 +8,23 @@
|
||||
#include <AK/Format.h>
|
||||
#include <assert.h>
|
||||
#include <sys/resource.h>
|
||||
#include <syscall.h>
|
||||
#include <ulimit.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
long ulimit([[maybe_unused]] int cmd, [[maybe_unused]] long newlimit)
|
||||
{
|
||||
dbgln("FIXME: Implement getrusage()");
|
||||
dbgln("FIXME: Implement ulimit()");
|
||||
TODO();
|
||||
return -1;
|
||||
}
|
||||
|
||||
int getrusage([[maybe_unused]] int who, [[maybe_unused]] struct rusage* usage)
|
||||
// https://pubs.opengroup.org/onlinepubs/009696699/functions/getrusage.html
|
||||
int getrusage(int who, struct rusage* usage)
|
||||
{
|
||||
dbgln("FIXME: Implement getrusage()");
|
||||
return -1;
|
||||
int rc = syscall(SC_getrusage, who, usage);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int getrlimit([[maybe_unused]] int resource, rlimit* rl)
|
||||
|
Loading…
Reference in New Issue
Block a user