Blame bits/resource.h

Packit 6c4009
/* Bit values & structures for resource limits.  4.4 BSD/generic GNU version.
Packit 6c4009
   Copyright (C) 1994-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _SYS_RESOURCE_H
Packit 6c4009
# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#include <bits/types.h>
Packit 6c4009
Packit 6c4009
/* These are the values for 4.4 BSD and GNU.  Earlier BSD systems have a
Packit 6c4009
   subset of these kinds of resource limit.  In systems where `getrlimit'
Packit 6c4009
   and `setrlimit' are not system calls, these are the values used by the C
Packit 6c4009
   library to emulate them.  */
Packit 6c4009
Packit 6c4009
/* Kinds of resource limit.  */
Packit 6c4009
enum __rlimit_resource
Packit 6c4009
  {
Packit 6c4009
    /* Per-process CPU limit, in seconds.  */
Packit 6c4009
    RLIMIT_CPU,
Packit 6c4009
#define	RLIMIT_CPU	RLIMIT_CPU
Packit 6c4009
    /* Largest file that can be created, in bytes.  */
Packit 6c4009
    RLIMIT_FSIZE,
Packit 6c4009
#define	RLIMIT_FSIZE	RLIMIT_FSIZE
Packit 6c4009
    /* Maximum size of data segment, in bytes.  */
Packit 6c4009
    RLIMIT_DATA,
Packit 6c4009
#define	RLIMIT_DATA	RLIMIT_DATA
Packit 6c4009
    /* Maximum size of stack segment, in bytes.  */
Packit 6c4009
    RLIMIT_STACK,
Packit 6c4009
#define	RLIMIT_STACK	RLIMIT_STACK
Packit 6c4009
    /* Largest core file that can be created, in bytes.  */
Packit 6c4009
    RLIMIT_CORE,
Packit 6c4009
#define	RLIMIT_CORE	RLIMIT_CORE
Packit 6c4009
    /* Largest resident set size, in bytes.
Packit 6c4009
       This affects swapping; processes that are exceeding their
Packit 6c4009
       resident set size will be more likely to have physical memory
Packit 6c4009
       taken from them.  */
Packit 6c4009
    RLIMIT_RSS,
Packit 6c4009
#define	RLIMIT_RSS	RLIMIT_RSS
Packit 6c4009
    /* Locked-in-memory address space.  */
Packit 6c4009
    RLIMIT_MEMLOCK,
Packit 6c4009
#define	RLIMIT_MEMLOCK	RLIMIT_MEMLOCK
Packit 6c4009
    /* Number of processes.  */
Packit 6c4009
    RLIMIT_NPROC,
Packit 6c4009
#define	RLIMIT_NPROC	RLIMIT_NPROC
Packit 6c4009
    /* Number of open files.  */
Packit 6c4009
    RLIMIT_OFILE,
Packit 6c4009
    RLIMIT_NOFILE = RLIMIT_OFILE, /* Another name for the same thing.  */
Packit 6c4009
#define	RLIMIT_OFILE	RLIMIT_OFILE
Packit 6c4009
#define	RLIMIT_NOFILE	RLIMIT_NOFILE
Packit 6c4009
    /* Maximum size of all socket buffers.  */
Packit 6c4009
    RLIMIT_SBSIZE,
Packit 6c4009
#define RLIMIT_SBSIZE	RLIMIT_SBSIZE
Packit 6c4009
    /* Maximum size in bytes of the process address space.  */
Packit 6c4009
    RLIMIT_AS,
Packit 6c4009
    RLIMIT_VMEM = RLIMIT_AS,	/* Another name for the same thing.  */
Packit 6c4009
#define RLIMIT_AS	RLIMIT_AS
Packit 6c4009
#define RLIMIT_VMEM	RLIMIT_AS
Packit 6c4009
Packit 6c4009
    RLIMIT_NLIMITS,		/* Number of limit flavors.  */
Packit 6c4009
    RLIM_NLIMITS = RLIMIT_NLIMITS /* Traditional name for same.  */
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
/* Value to indicate that there is no limit.  */
Packit 6c4009
#ifndef __USE_FILE_OFFSET64
Packit 6c4009
# define RLIM_INFINITY 0x7fffffff
Packit 6c4009
#else
Packit 6c4009
# define RLIM_INFINITY 0x7fffffffffffffffLL
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_LARGEFILE64
Packit 6c4009
# define RLIM64_INFINITY 0x7fffffffffffffffLL
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* We can represent all limits.  */
Packit 6c4009
#define RLIM_SAVED_MAX	RLIM_INFINITY
Packit 6c4009
#define RLIM_SAVED_CUR	RLIM_INFINITY
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Type for resource quantity measurement.  */
Packit 6c4009
#ifndef __USE_FILE_OFFSET64
Packit 6c4009
typedef __rlim_t rlim_t;
Packit 6c4009
#else
Packit 6c4009
typedef __rlim64_t rlim_t;
Packit 6c4009
#endif
Packit 6c4009
#ifdef __USE_LARGEFILE64
Packit 6c4009
typedef __rlim64_t rlim64_t;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
struct rlimit
Packit 6c4009
  {
Packit 6c4009
    /* The current (soft) limit.  */
Packit 6c4009
    rlim_t rlim_cur;
Packit 6c4009
    /* The hard limit.  */
Packit 6c4009
    rlim_t rlim_max;
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
#ifdef __USE_LARGEFILE64
Packit 6c4009
struct rlimit64
Packit 6c4009
  {
Packit 6c4009
    /* The current (soft) limit.  */
Packit 6c4009
    rlim64_t rlim_cur;
Packit 6c4009
    /* The hard limit.  */
Packit 6c4009
    rlim64_t rlim_max;
Packit 6c4009
 };
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Whose usage statistics do you want?  */
Packit 6c4009
enum __rusage_who
Packit 6c4009
/* The macro definitions are necessary because some programs want
Packit 6c4009
   to test for operating system features with #ifdef RUSAGE_SELF.
Packit 6c4009
   In ISO C the reflexive definition is a no-op.  */
Packit 6c4009
  {
Packit 6c4009
    /* The calling process.  */
Packit 6c4009
    RUSAGE_SELF = 0,
Packit 6c4009
#define RUSAGE_SELF     RUSAGE_SELF
Packit 6c4009
    /* All of its terminated child processes.  */
Packit 6c4009
    RUSAGE_CHILDREN = -1
Packit 6c4009
#define RUSAGE_CHILDREN RUSAGE_CHILDREN
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
#include <bits/types/struct_timeval.h>
Packit 6c4009
#include <bits/types/struct_rusage.h>
Packit 6c4009
Packit 6c4009
/* Priority limits.  */
Packit 6c4009
#define PRIO_MIN        -20     /* Minimum priority a process can have.  */
Packit 6c4009
#define PRIO_MAX        20      /* Maximum priority a process can have.  */
Packit 6c4009
Packit 6c4009
/* The type of the WHICH argument to `getpriority' and `setpriority',
Packit 6c4009
   indicating what flavor of entity the WHO argument specifies.  */
Packit 6c4009
enum __priority_which
Packit 6c4009
  {
Packit 6c4009
    PRIO_PROCESS = 0,           /* WHO is a process ID.  */
Packit 6c4009
#define PRIO_PROCESS PRIO_PROCESS
Packit 6c4009
    PRIO_PGRP = 1,              /* WHO is a process group ID.  */
Packit 6c4009
#define PRIO_PGRP PRIO_PGRP
Packit 6c4009
    PRIO_USER = 2               /* WHO is a user ID.  */
Packit 6c4009
#define PRIO_USER PRIO_USER
Packit 6c4009
  };