2020-01-18 09:38:21 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
|
2019-05-21 21:36:08 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2021-05-08 05:04:56 +02:00
|
|
|
#include <stdint.h>
|
2019-05-21 21:36:08 +02:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
|
|
|
|
__BEGIN_DECLS
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
2019-05-28 11:53:16 +02:00
|
|
|
int getrusage(int who, struct rusage* usage);
|
2019-05-21 21:36:08 +02:00
|
|
|
|
2021-05-08 05:04:56 +02:00
|
|
|
#define RLIMIT_CORE 1
|
|
|
|
|
#define RLIMIT_CPU 2
|
|
|
|
|
#define RLIMIT_DATA 3
|
|
|
|
|
#define RLIMIT_FSIZE 4
|
|
|
|
|
#define RLIMIT_NOFILE 5
|
|
|
|
|
#define RLIMIT_STACK 6
|
|
|
|
|
#define RLIMIT_AS 7
|
|
|
|
|
|
|
|
|
|
#define RLIM_INFINITY SIZE_MAX
|
|
|
|
|
|
|
|
|
|
struct rlimit {
|
|
|
|
|
size_t rlim_cur;
|
|
|
|
|
size_t rlim_max;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int getrlimit(int, struct rlimit*);
|
|
|
|
|
int setrlimit(int, struct rlimit const*);
|
|
|
|
|
|
2019-05-21 21:36:08 +02:00
|
|
|
__END_DECLS
|