diff options
Diffstat (limited to 'src/bun.js/bindings/c-bindings.cpp')
-rw-r--r-- | src/bun.js/bindings/c-bindings.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bun.js/bindings/c-bindings.cpp b/src/bun.js/bindings/c-bindings.cpp new file mode 100644 index 000000000..8ed868c77 --- /dev/null +++ b/src/bun.js/bindings/c-bindings.cpp @@ -0,0 +1,13 @@ +// when we don't want to use @cInclude, we can just stick wrapper functions here +#include <sys/resource.h> +#include <cstdint> + +extern "C" int32_t get_process_priority(uint32_t pid) +{ + return getpriority(PRIO_PROCESS, pid); +} + +extern "C" int32_t set_process_priority(uint32_t pid, int32_t priority) +{ + return setpriority(PRIO_PROCESS, pid, priority); +}
\ No newline at end of file |