1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

Kernel: Add getrusage() syscall

Only the two timeval fields are maintained, as required by the POSIX
standard.
This commit is contained in:
Lucas CHOLLET 2022-01-31 22:09:30 +01:00 committed by Andreas Kling
parent 39bfc48ea7
commit 839d3d9f74
5 changed files with 83 additions and 2 deletions

View file

@ -0,0 +1,40 @@
/*
* Copyright (c) 2022, Lucas Chollet <lucas.chollet@free.fr>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <Kernel/API/POSIX/sys/time.h>
#include <Kernel/API/POSIX/sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct rusage {
struct timeval ru_utime;
struct timeval ru_stime;
long ru_maxrss;
long ru_ixrss;
long ru_idrss;
long ru_isrss;
long ru_minflt;
long ru_majflt;
long ru_nswap;
long ru_inblock;
long ru_oublock;
long ru_msgsnd;
long ru_msgrcv;
long ru_nsignals;
long ru_nvcsw;
long ru_nivcsw;
};
#define RUSAGE_SELF 1
#define RUSAGE_CHILDREN 2
#ifdef __cplusplus
}
#endif