Remove malloc() dependency on pledge() / unveil()

This change also fixes a bug with gettid() being incorrect after fork().
We now implement the ENOENT behavior for getauxval(). The getuid() etc.
system calls are now faster too. Plus issetugid() will work on BSDs.
This commit is contained in:
Justine Tunney 2022-07-24 19:40:32 -07:00
parent c921dc78f0
commit 3d2cf95af1
33 changed files with 270 additions and 100 deletions

View file

@ -1,2 +0,0 @@
.include "o/libc/sysv/macros.internal.inc"
.scall issetugid,0xfff0fd0fd2147fff,globl

View file

@ -0,0 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_issetugid,0xfff0fd0fd2147fff,globl,hidden

View file

@ -17,6 +17,7 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/dce.h"
#include "libc/nexgen32e/vendor.internal.h"
const char *__describe_os(void) {
if (IsLinux()) {

View file

@ -422,7 +422,7 @@ scall __bsd_seteuid 0xfff0b70b720b7fff globl hidden # wrapped via setreuid()
scall __bsd_setegid 0xfff0b60b620b6fff globl hidden # wrapped via setregid()
scall fpathconf 0x0c00c00c020c0fff globl
scall fhopen 0x18c10812a20f8fff globl
scall issetugid 0xfff0fd0fd2147fff globl
scall sys_issetugid 0xfff0fd0fd2147fff globl hidden
scall minherit 0x1110fa0fa20fafff globl
scall pathconf 0x0bf0bf0bf20bffff globl
scall sysctl 0x0ca0ca0ca20cafff globl