From 912fba95e74c7631352bc5007249d75e720bbcdf Mon Sep 17 00:00:00 2001 From: rsc Date: Mon, 24 Nov 2003 22:39:06 +0000 Subject: Changes for Mac OS X. Most important is stack sizes in samterm, which were completely bogus. (Libthread used to ignore them but not anymore. Maybe we really should ignore them, but that breaks Venti, which needs *really* big stacks.) --- src/lib9/await.c | 2 +- src/lib9/dirread.c | 13 ++++++++----- src/lib9/ffork-pthread.c | 4 +++- src/lib9/mkfile | 1 - src/lib9/tas-PowerMacintosh.c | 4 ++-- 5 files changed, 14 insertions(+), 10 deletions(-) (limited to 'src/lib9') diff --git a/src/lib9/await.c b/src/lib9/await.c index 56d79b79..89c695ae 100644 --- a/src/lib9/await.c +++ b/src/lib9/await.c @@ -4,9 +4,9 @@ #include #include +#include #include #include -#include static struct { int sig; diff --git a/src/lib9/dirread.c b/src/lib9/dirread.c index 359b09ec..2e1ce886 100644 --- a/src/lib9/dirread.c +++ b/src/lib9/dirread.c @@ -11,12 +11,16 @@ extern int _p9dir(struct stat*, char*, Dir*, char**, char*); -#if !defined(_HAVEGETDENTS) && defined(_HAVEGETDIRENTRIES) +/* everyone has getdirentries, just use that */ static int -getdents(int fd, char *buf, int n) +mygetdents(int fd, char *buf, int n) { ssize_t nn; +#if _GETDIRENTRIES_TAKES_LONG + long off; +#else off_t off; +#endif off = seek(fd, 0, 1); nn = getdirentries(fd, buf, n, &off); @@ -24,7 +28,6 @@ getdents(int fd, char *buf, int n) seek(fd, off, 0); return nn; } -#endif static int countde(char *p, int n) @@ -123,7 +126,7 @@ dirread(int fd, Dir **dp) if(buf == nil) return -1; - n = getdents(fd, (void*)buf, st.st_blksize); + n = mygetdents(fd, (void*)buf, st.st_blksize); if(n < 0){ free(buf); return -1; @@ -156,7 +159,7 @@ dirreadall(int fd, Dir **d) return -1; } buf = nbuf; - n = getdents(fd, (void*)(buf+ts), st.st_blksize); + n = mygetdents(fd, (void*)(buf+ts), st.st_blksize); if(n <= 0) break; ts += n; diff --git a/src/lib9/ffork-pthread.c b/src/lib9/ffork-pthread.c index 189ac94f..397f8aa6 100644 --- a/src/lib9/ffork-pthread.c +++ b/src/lib9/ffork-pthread.c @@ -1,4 +1,6 @@ -#include +#define NOPLAN9DEFINES +#include +#include #include extern int __isthreaded; diff --git a/src/lib9/mkfile b/src/lib9/mkfile index deb69249..a34cdc69 100644 --- a/src/lib9/mkfile +++ b/src/lib9/mkfile @@ -38,7 +38,6 @@ OFILES=\ getuser.$O\ getwd.$O\ jmp.$O\ - jmp-$SYSNAME.$O\ lock.$O\ main.$O\ malloctag.$O\ diff --git a/src/lib9/tas-PowerMacintosh.c b/src/lib9/tas-PowerMacintosh.c index 29928ce0..d7a8610c 100644 --- a/src/lib9/tas-PowerMacintosh.c +++ b/src/lib9/tas-PowerMacintosh.c @@ -6,7 +6,7 @@ * r3 contains return value upon return. */ int -_tas(void *x) +_tas(int *x) { int v; /* @@ -36,7 +36,7 @@ _tas(void *x) switch(v) { case 0: return 0; case 0xdeaddead: return 1; - default: print("tas: corrupted 0x%lux\n", v); + default: fprint(2, "tas: corrupted 0x%lux\n", v); } return 0; } -- cgit v1.2.3