Add epoll and do more release readiness changes

This change also pays off some of the remaining technical debt with
stdio, file descriptors, and memory managemnt polyfills.
This commit is contained in:
Justine Tunney 2020-11-28 12:01:51 -08:00
parent a9ea949df8
commit 3e4fd4b0ad
271 changed files with 5706 additions and 1365 deletions

View file

@ -898,10 +898,11 @@ void SetupDraw(void) {
static long Disassemble(void) {
long lines, current;
lines = pan.disassembly.bottom - pan.disassembly.top * 2;
CHECK_NE(-1, Dis(dis, m, GetIp(), m->ip, lines));
current = DisFind(dis, GetIp());
CHECK_NE(-1, current);
return current;
if (Dis(dis, m, GetIp(), m->ip, lines) != -1) {
return DisFind(dis, GetIp());
} else {
return -1;
}
}
static long GetDisIndex(void) {

View file

@ -1227,7 +1227,11 @@ static int OpGetPpid(struct Machine *m) {
}
static int OpKill(struct Machine *m, int pid, int sig) {
return kill(pid, sig);
if (pid == getpid()) {
ThrowProtectionFault(m);
} else {
return kill(pid, sig);
}
}
static int OpGetUid(struct Machine *m) {

View file

@ -17,6 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "ape/relocations.h"
#include "libc/alg/arraylist2.internal.h"
#include "libc/calls/calls.h"
#include "libc/calls/struct/stat.h"
@ -139,6 +140,9 @@ int main(int argc, char *argv[]) {
APPENDSTR("#define IMAGE_BASE_VIRTUAL ");
AppendInt(IMAGE_BASE_VIRTUAL);
APPENDSTR("\n");
APPENDSTR("#define IMAGE_BASE_PHYSICAL ");
AppendInt(IMAGE_BASE_PHYSICAL);
APPENDSTR("\n");
for (i = 1; i < argc; ++i) {
Visit(argv[i]);
}