Make cosmo.ftrace() in Python easier to use

This commit is contained in:
Justine Tunney 2022-11-03 01:12:25 -07:00
parent 89d1e5b8f2
commit c2590cf7a0
No known key found for this signature in database
GPG key ID: BE714B4575D6E328

View file

@ -19,6 +19,7 @@
#define PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN
#include "dsp/scale/cdecimate2xuint8x8.h" #include "dsp/scale/cdecimate2xuint8x8.h"
#include "libc/calls/calls.h" #include "libc/calls/calls.h"
#include "libc/calls/pledge.h"
#include "libc/dce.h" #include "libc/dce.h"
#include "libc/errno.h" #include "libc/errno.h"
#include "libc/intrin/popcnt.h" #include "libc/intrin/popcnt.h"
@ -207,6 +208,7 @@ cosmo_pledge(PyObject *self, PyObject *args)
int e = errno; int e = errno;
const char *x, *y; const char *x, *y;
if (!PyArg_ParseTuple(args, "sz:pledge", &x, &y)) return 0; if (!PyArg_ParseTuple(args, "sz:pledge", &x, &y)) return 0;
__pledge_mode = PLEDGE_PENALTY_RETURN_EPERM;
if (!pledge(x, y)) { if (!pledge(x, y)) {
Py_RETURN_NONE; Py_RETURN_NONE;
} else { } else {