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#ifndef DT_WIN_RLIMIT_H
22#define DT_WIN_RLIMIT_H
23
24#include <stdio.h>
25
26#define RLIMIT_CPU 0 /* limit on CPU time per process */
27#define RLIMIT_FSIZE 1 /* limit on file size */
28#define RLIMIT_DATA 2 /* limit on data segment size */
29#define RLIMIT_STACK 3 /* limit on process stack size */
30#define RLIMIT_CORE 4 /* limit on size of core dump file */
31#define RLIMIT_NOFILE 5 /* limit on number of open files */
32#define RLIMIT_AS 6 /* limit on process total address space size */
33#define RLIMIT_VMEM RLIMIT_AS
34#define RLIM_NLIMITS 7
35#define RLIM_INFINITY (~0UL)
36
37/*
38 * process resource limits definitions
39 */
40
41struct rlimit
42{
43 // LARGE_INTEGER rlim_cur;
44 // LARGE_INTEGER rlim_max;
45 __int64 rlim_cur;
46 __int64 rlim_max;
47};
48
49typedef struct rlimit rlimit_t;
50
51/*
52 * Prototypes
53 */
54int getrlimit(int resource, struct rlimit *);
55int setrlimit(int resource, const struct rlimit *);
56
57size_t rfwrite(const void *buffer, size_t size, size_t count, FILE *stream);
58int _rwrite(int handle, const void *buffer, unsigned int count);
59
60#endif // DT_WIN_RLIMIT_H
61
62// clang-format off
63// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
64// vim: shiftwidth=2 expandtab tabstop=2 cindent
65// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
66// clang-format on
67
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
__int64 rlim_cur
Definition rlimit.h:45
__int64 rlim_max
Definition rlimit.h:46