diff options
author | 2020-10-28 17:59:00 -0400 | |
---|---|---|
committer | 2020-10-28 17:59:00 -0400 | |
commit | c55872394b852d0d05e1ad6cc4c3f27aaaf0d04e (patch) | |
tree | 41b85f329d7471965f380e0859b4fd90b186b295 /lib_pypy | |
parent | add resource.prlimit() (added in CPython 3.4) (diff) | |
download | pypy-c55872394b852d0d05e1ad6cc4c3f27aaaf0d04e.tar.gz pypy-c55872394b852d0d05e1ad6cc4c3f27aaaf0d04e.tar.bz2 pypy-c55872394b852d0d05e1ad6cc4c3f27aaaf0d04e.zip |
only compile my_prlimit header on Linux
Diffstat (limited to 'lib_pypy')
-rw-r--r-- | lib_pypy/_resource_build.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib_pypy/_resource_build.py b/lib_pypy/_resource_build.py index f46d437b40..7044bae9a3 100644 --- a/lib_pypy/_resource_build.py +++ b/lib_pypy/_resource_build.py @@ -1,4 +1,5 @@ from cffi import FFI +import sys ffi = FFI() @@ -125,12 +126,15 @@ void getrusage(int who, struct rusage *result); int my_getrlimit(int resource, long long result[2]); int my_setrlimit(int resource, long long cur, long long max); -int my_prlimit(int pid, int resource, int set, long long cur, long long max, long long result[2]); - int wait3(int *status, int options, struct rusage *rusage); int wait4(int pid, int *status, int options, struct rusage *rusage); """) +if sys.platform.startswith("linux"): + ffi.cdef(""" +int my_prlimit(int pid, int resource, int set, long long cur, long long max, long long result[2]); +""") + if __name__ == "__main__": ffi.compile() |