Commit 060c05a1 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Some simple signal+resource support for the tester selfhost

parent e8506fef
......@@ -46,6 +46,7 @@
#define HAVE_EPOLL 1
#define HAVE_POLL 1
#define HAVE_SELECT 1
#define HAVE_ALARM 1
#define PY_FORMAT_LONG_LONG "ll"
#define PY_FORMAT_SIZE_T "z"
......
......@@ -543,6 +543,9 @@ extern "C" Py_ssize_t PySequence_Index(PyObject* o, PyObject* value) noexcept {
}
extern "C" PyObject* PySequence_Tuple(PyObject* o) noexcept {
if (o->cls == tuple_cls)
return o;
Py_FatalError("unimplemented");
}
......
......@@ -4,3 +4,9 @@ for k in sorted(dir(resource)):
if not k.startswith("RLIMIT_"):
continue
print k, getattr(resource, k)
TIME_LIMIT = 100
resource.setrlimit(resource.RLIMIT_CPU, (TIME_LIMIT + 1, TIME_LIMIT + 1))
MAX_MEM_MB = 100
resource.setrlimit(resource.RLIMIT_RSS, (MAX_MEM_MB * 1024 * 1024, MAX_MEM_MB * 1024 * 1024))
......@@ -4,3 +4,5 @@ for k in sorted(dir(signal)):
if not k.startswith("SIG"):
continue
print k, getattr(signal, k)
print hasattr(signal, "alarm")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment