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