18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci#ifndef _UAPI_ASM_GENERIC_RESOURCE_H
38c2ecf20Sopenharmony_ci#define _UAPI_ASM_GENERIC_RESOURCE_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci/*
68c2ecf20Sopenharmony_ci * Resource limit IDs
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * ( Compatibility detail: there are architectures that have
98c2ecf20Sopenharmony_ci *   a different rlimit ID order in the 5-9 range and want
108c2ecf20Sopenharmony_ci *   to keep that order for binary compatibility. The reasons
118c2ecf20Sopenharmony_ci *   are historic and all new rlimits are identical across all
128c2ecf20Sopenharmony_ci *   arches. If an arch has such special order for some rlimits
138c2ecf20Sopenharmony_ci *   then it defines them prior including asm-generic/resource.h. )
148c2ecf20Sopenharmony_ci */
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#define RLIMIT_CPU		0	/* CPU time in sec */
178c2ecf20Sopenharmony_ci#define RLIMIT_FSIZE		1	/* Maximum filesize */
188c2ecf20Sopenharmony_ci#define RLIMIT_DATA		2	/* max data size */
198c2ecf20Sopenharmony_ci#define RLIMIT_STACK		3	/* max stack size */
208c2ecf20Sopenharmony_ci#define RLIMIT_CORE		4	/* max core file size */
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#ifndef RLIMIT_RSS
238c2ecf20Sopenharmony_ci# define RLIMIT_RSS		5	/* max resident set size */
248c2ecf20Sopenharmony_ci#endif
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#ifndef RLIMIT_NPROC
278c2ecf20Sopenharmony_ci# define RLIMIT_NPROC		6	/* max number of processes */
288c2ecf20Sopenharmony_ci#endif
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#ifndef RLIMIT_NOFILE
318c2ecf20Sopenharmony_ci# define RLIMIT_NOFILE		7	/* max number of open files */
328c2ecf20Sopenharmony_ci#endif
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#ifndef RLIMIT_MEMLOCK
358c2ecf20Sopenharmony_ci# define RLIMIT_MEMLOCK		8	/* max locked-in-memory address space */
368c2ecf20Sopenharmony_ci#endif
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#ifndef RLIMIT_AS
398c2ecf20Sopenharmony_ci# define RLIMIT_AS		9	/* address space limit */
408c2ecf20Sopenharmony_ci#endif
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define RLIMIT_LOCKS		10	/* maximum file locks held */
438c2ecf20Sopenharmony_ci#define RLIMIT_SIGPENDING	11	/* max number of pending signals */
448c2ecf20Sopenharmony_ci#define RLIMIT_MSGQUEUE		12	/* maximum bytes in POSIX mqueues */
458c2ecf20Sopenharmony_ci#define RLIMIT_NICE		13	/* max nice prio allowed to raise to
468c2ecf20Sopenharmony_ci					   0-39 for nice level 19 .. -20 */
478c2ecf20Sopenharmony_ci#define RLIMIT_RTPRIO		14	/* maximum realtime priority */
488c2ecf20Sopenharmony_ci#define RLIMIT_RTTIME		15	/* timeout for RT tasks in us */
498c2ecf20Sopenharmony_ci#define RLIM_NLIMITS		16
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci/*
528c2ecf20Sopenharmony_ci * SuS says limits have to be unsigned.
538c2ecf20Sopenharmony_ci * Which makes a ton more sense anyway.
548c2ecf20Sopenharmony_ci *
558c2ecf20Sopenharmony_ci * Some architectures override this (for compatibility reasons):
568c2ecf20Sopenharmony_ci */
578c2ecf20Sopenharmony_ci#ifndef RLIM_INFINITY
588c2ecf20Sopenharmony_ci# define RLIM_INFINITY		(~0UL)
598c2ecf20Sopenharmony_ci#endif
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#endif /* _UAPI_ASM_GENERIC_RESOURCE_H */
63