Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
rlimit.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2017-2020 darktable developers.
4
5 darktable is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 darktable is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with darktable. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20
21#include <stdio.h>
22
23#define RLIMIT_CPU 0 /* limit on CPU time per process */
24#define RLIMIT_FSIZE 1 /* limit on file size */
25#define RLIMIT_DATA 2 /* limit on data segment size */
26#define RLIMIT_STACK 3 /* limit on process stack size */
27#define RLIMIT_CORE 4 /* limit on size of core dump file */
28#define RLIMIT_NOFILE 5 /* limit on number of open files */
29#define RLIMIT_AS 6 /* limit on process total address space size */
30#define RLIMIT_VMEM RLIMIT_AS
31#define RLIM_NLIMITS 7
32#define RLIM_INFINITY (~0UL)
33
34/*
35 * process resource limits definitions
36 */
37
38struct rlimit
39{
40 // LARGE_INTEGER rlim_cur;
41 // LARGE_INTEGER rlim_max;
42 __int64 rlim_cur;
43 __int64 rlim_max;
44};
45
46typedef struct rlimit rlimit_t;
47
48/*
49 * Prototypes
50 */
51int getrlimit(int resource, struct rlimit *);
52int setrlimit(int resource, const struct rlimit *);
53
54size_t rfwrite(const void *buffer, size_t size, size_t count, FILE *stream);
55int _rwrite(int handle, const void *buffer, unsigned int count);
56
57// clang-format off
58// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
59// vim: shiftwidth=2 expandtab tabstop=2 cindent
60// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
61// clang-format on
62
size_t size
Definition mipmap_cache.c:3
size_t rfwrite(const void *buffer, size_t size, size_t count, FILE *stream)
Definition rlimit.c:137
int setrlimit(int resource, const struct rlimit *)
Definition rlimit.c:105
int getrlimit(int resource, struct rlimit *)
Definition rlimit.c:75
int _rwrite(int handle, const void *buffer, unsigned int count)
Definition rlimit.c:170
Definition rlimit.h:39
__int64 rlim_cur
Definition rlimit.h:42
__int64 rlim_max
Definition rlimit.h:43