mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 09:48:29 +00:00
Introduce #include <cosmo.h>
to toolchain users
This change improves the way internal APIs are being hidden behind the `COSMO` define. The cosmo.h header will take care of defining that, so that a separate define statement isn't needed. This change also does a lot more to define which APIs are standard, and which belong to Cosmo.
This commit is contained in:
parent
9b55dbe417
commit
4a59210008
115 changed files with 699 additions and 422 deletions
|
@ -23,7 +23,7 @@
|
|||
#include "libc/calls/pledge.internal.h"
|
||||
#include "libc/calls/struct/rlimit.h"
|
||||
#include "libc/calls/struct/sched_param.h"
|
||||
#include "libc/calls/struct/seccomp.h"
|
||||
#include "libc/calls/struct/seccomp.internal.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/calls/struct/sysinfo.h"
|
||||
#include "libc/calls/syscall-sysv.internal.h"
|
||||
|
@ -373,24 +373,6 @@ int UnveilIfExists(const char *path, const char *perm) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
void MakeProcessNice(void) {
|
||||
if (!g_nice) return;
|
||||
if (setpriority(PRIO_PROCESS, 0, 19) == -1) {
|
||||
kprintf("error: setpriority(PRIO_PROCESS, 0, 19) failed: %m\n");
|
||||
exit(23);
|
||||
}
|
||||
if (ioprio_set(IOPRIO_WHO_PROCESS, 0,
|
||||
IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0)) == -1) {
|
||||
kprintf("error: ioprio_set() failed: %m\n");
|
||||
exit(23);
|
||||
}
|
||||
struct sched_param p = {sched_get_priority_min(SCHED_IDLE)};
|
||||
if (sched_setscheduler(0, SCHED_IDLE, &p) == -1) {
|
||||
kprintf("error: sched_setscheduler(SCHED_IDLE) failed: %m\n");
|
||||
exit(23);
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyFilesystemPolicy(unsigned long ipromises) {
|
||||
const char *p;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue