|
@@ -44,6 +44,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
#include <signal.h>
|
|
#include <signal.h>
|
|
#include <stdatomic.h>
|
|
#include <stdatomic.h>
|
|
#include <string.h>
|
|
#include <string.h>
|
|
|
|
+#include <sys/param.h>
|
|
#include <sys/resource.h>
|
|
#include <sys/resource.h>
|
|
#include <sys/sysinfo.h>
|
|
#include <sys/sysinfo.h>
|
|
#include <systemd/sd-daemon.h>
|
|
#include <systemd/sd-daemon.h>
|
|
@@ -59,6 +60,10 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
*/
|
|
*/
|
|
#define NICE_DEFAULT_PRIORITY -4
|
|
#define NICE_DEFAULT_PRIORITY -4
|
|
|
|
|
|
|
|
+/* Value clamping helper.
|
|
|
|
+ */
|
|
|
|
+#define CLAMP(lbound, ubound, value) MIN(MIN(lbound, ubound), MAX(MAX(lbound, ubound), value))
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* The GameModeClient encapsulates the remote connection, providing a list
|
|
* The GameModeClient encapsulates the remote connection, providing a list
|
|
* form to contain the pid and credentials.
|
|
* form to contain the pid and credentials.
|