mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-18 16:40:32 +00:00
Improve pledge() usability and consistency
- We now kill the program on violations like OpenBSD - We now print a message explaining which promise is needed - This change also fixes a linkage bug with thread local storage - Your sigaction() handlers should now be more thread safe A new `__pledge_mode` global has been introduced to make pledge() more customizable on Linux. For example: __attribute__((__constructor__)) static void init(void) { __pledge_mode = SECCOMP_RET_ERRNO | EPERM; } Can be used to restore our old permissive pledge() behavior.
This commit is contained in:
parent
13c1c45075
commit
5546559034
30 changed files with 713 additions and 86 deletions
19
libc/sysv/consts/loglevel.h
Normal file
19
libc/sysv/consts/loglevel.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_LOGLEVEL_H_
|
||||
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_LOGLEVEL_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define LOGLEVEL_SCHED -2
|
||||
#define LOGLEVEL_DEFAULT -1
|
||||
#define LOGLEVEL_EMERG 0
|
||||
#define LOGLEVEL_ALERT 1
|
||||
#define LOGLEVEL_CRIT 2
|
||||
#define LOGLEVEL_ERR 3
|
||||
#define LOGLEVEL_WARNING 4
|
||||
#define LOGLEVEL_NOTICE 5
|
||||
#define LOGLEVEL_INFO 6
|
||||
#define LOGLEVEL_DEBUG 7
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_LOGLEVEL_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue