haproxy/include/haproxy/limits.h
Valentine Krasnobaeva 9302869c95 BUG/MINOR: limits: fix license type in limits.h
Need to use LGPL-2.1-or-later in headers since our hedaers default
to LGPL.
2024-07-11 18:15:48 +02:00

28 lines
770 B
C

/*
* Handlers for process resources limits.
*
* SPDX-License-Identifier: LGPL-2.1-or-later.
*
*/
#ifndef _HAPROXY_LIMITS_H
#define _HAPROXY_LIMITS_H
#include <sys/resource.h>
extern unsigned int rlim_fd_cur_at_boot;
extern unsigned int rlim_fd_max_at_boot;
/* handlers to compute internal process limits, if they are not provided via
* cmd line or via configuration file.
*/
int compute_ideal_maxpipes();
int compute_ideal_maxconn();
int compute_ideal_maxsock(int maxconn);
int check_if_maxsock_permitted(int maxsock);
/* handlers to manipulate system resources limits granted by OS to process and
* to tie them up with the internal process limits
*/
int raise_rlim_nofile(struct rlimit *old_limit, struct rlimit *new_limit);
#endif /* _HAPROXY_LIMITS_H */