#define __NR_inotify_init1 332
#define __NR_preadv 333
#define __NR_pwritev 334
+#define __NR_prlimit64 340
/* fixup legacy 16-bit junk */
#undef __NR_lchown
#define SYS_inotify_init1 332
#define SYS_preadv 333
#define SYS_pwritev 334
+#define SYS_prlimit64 340
/* fixup legacy 16-bit junk */
#undef SYS_lchown
#define __NEED_time_t
#define __NEED_struct_timeval
+#ifdef _GNU_SOURCE
+#define __NEED_pid_t
+#endif
+
#include <bits/alltypes.h>
typedef unsigned long long rlim_t;
int getpriority (int, id_t);
int setpriority (int, id_t, int);
+#ifdef _GNU_SOURCE
+int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
+#endif
+
#define PRIO_PROCESS 0
#define PRIO_PGRP 1
#define PRIO_USER 2
--- /dev/null
+#include <unistd.h>
+#include <sys/resource.h>
+#include "syscall.h"
+
+int prlimit(pid_t pid, int resource, const struct rlimit *new_limit, struct rlimit *old_limit)
+{
+ return syscall(SYS_prlimit64, pid, resource, new_limit, old_limit);
+}