#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
#include <errno.h>
#include "fallback.h"
#include "util.h"
#include "builtin.h"
#include "common.h"
#include "wgetopt.h"
Data Structures | |
| struct | resource_t |
| Struct describing a resource limit. More... | |
Functions | |
| static int | get_multiplier (int what) |
| Get the implicit multiplication factor for the specified resource limit. | |
| static rlim_t | get (int resource, int hard) |
| Return the value for the specified resource limit. | |
| static void | print (int resource, int hard) |
| Print the value of the specified resource limit. | |
| static void | print_all (int hard) |
| Print values of all resource limits. | |
| static const wchar_t * | get_desc (int what) |
| Returns the description for the specified resource limit. | |
| static int | set (int resource, int hard, int soft, rlim_t value) |
| Set the new value of the specified resource limit. | |
| static int | builtin_ulimit (wchar_t **argv) |
| The ulimit builtin, used for setting resource limits. | |
Variables | |
| static const struct resource_t | resource_arr [] |
| Array of resource_t structs, describing all known resource types. | |
Functions used for implementing the ulimit builtin.
| static int builtin_ulimit | ( | wchar_t ** | argv | ) | [static] |
The ulimit builtin, used for setting resource limits.
Defined in builtin_ulimit.c.
References builtin_count_args(), BUILTIN_ERR_UNKNOWN, builtin_print_help(), builtin_unknown_option(), woption::flag, get_multiplier(), woption::name, no_argument, print(), print_all(), sb_append, sb_err, sb_out, sb_printf(), wgetopt_long(), and woptind.
| static rlim_t get | ( | int | resource, | |
| int | hard | |||
| ) | [static] |
Return the value for the specified resource limit.
This function does _not_ multiply the limit value by the multiplier constant used by the commandline ulimit.
| static int set | ( | int | resource, | |
| int | hard, | |||
| int | soft, | |||
| rlim_t | value | |||
| ) | [static] |
Set the new value of the specified resource limit.
This function does _not_ multiply the limit value by the multiplier constant used by the commandline ulimit.
References builtin_wperror(), get_desc(), sb_err, and sb_printf().
1.5.6