Strengthen the pledge() polyfill

This commit is contained in:
Justine Tunney 2022-06-27 13:01:58 -07:00
parent a6f65eea7c
commit 3c92adfd6e
79 changed files with 1457 additions and 357 deletions

View file

@ -17,9 +17,14 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/bits/bits.h"
#include "libc/calls/calls.h"
#include "libc/testlib/ezbench.h"
#include "libc/testlib/testlib.h"
__attribute__((__constructor__)) static void init(void) {
pledge("stdio rpath", 0);
}
unsigned P[] = {
// 33333222222222111111111000000000
0b000011000000010000000001000000000, //
@ -106,7 +111,5 @@ TEST(bextra, 9bit) {
}
BENCH(bextra, bench) {
EZBENCH2("bextra 0/32", donothing, bextra(P, 0, 32));
EZBENCH2("bextra 1/31", donothing, bextra(P, 1, 31));
EZBENCH2("bextra 1/32", donothing, bextra(P, 1, 32));
}