mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Improve AARCH64 execution
This change fixes bugs in the APE loader. The execve() unit tests are now enabled for MODE=aarch64. See the README for how you need to have binfmt_misc configured with Qemu to run them. Apple Silicon bugs have been fixed too, e.g. tkill() now works.
This commit is contained in:
parent
1965d7488e
commit
77a7873057
31 changed files with 599 additions and 195 deletions
|
@ -17,6 +17,8 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
|
@ -31,9 +33,24 @@ __static_yoink("zipos");
|
|||
*/
|
||||
void testlib_extract(const char *zip, const char *to, int mode) {
|
||||
int fdin, fdout;
|
||||
ASSERT_NE(-1, (fdin = open(zip, O_RDONLY)));
|
||||
ASSERT_NE(-1, (fdout = creat(to, mode)));
|
||||
ASSERT_NE(-1, copyfd(fdin, fdout, -1));
|
||||
ASSERT_NE(-1, close(fdout));
|
||||
ASSERT_NE(-1, close(fdin));
|
||||
if ((fdin = open(zip, O_RDONLY)) == -1) {
|
||||
perror(zip);
|
||||
exit(1);
|
||||
}
|
||||
if ((fdout = creat(to, mode)) == -1) {
|
||||
perror(to);
|
||||
exit(1);
|
||||
}
|
||||
if (copyfd(fdin, fdout, -1) == -1) {
|
||||
perror(zip);
|
||||
exit(1);
|
||||
}
|
||||
if (close(fdout)) {
|
||||
perror(to);
|
||||
exit(1);
|
||||
}
|
||||
if (close(fdin)) {
|
||||
perror(zip);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue