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

@ -16,6 +16,7 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/calls/_getauxval.internal.h"
#include "libc/calls/calls.h"
#include "libc/dce.h"
#include "libc/fmt/conv.h"
@ -54,7 +55,7 @@ static dontinline int __clk_tck_init(void) {
x = -1;
}
} else {
x = getauxval(AT_CLKTCK);
x = _getauxval(AT_CLKTCK).value;
}
if (x < 1) x = 100;
clk_tck = x;