diff options
author | rsc <devnull@localhost> | 2003-11-24 22:39:06 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2003-11-24 22:39:06 +0000 |
commit | 912fba95e74c7631352bc5007249d75e720bbcdf (patch) | |
tree | b9c86c0c38c71d742ffd3990706f380f8263fd8d /src/lib9 | |
parent | 2db9e4821d8ae4889e63e5bb205b04eccb7af405 (diff) | |
download | plan9port-912fba95e74c7631352bc5007249d75e720bbcdf.tar.gz plan9port-912fba95e74c7631352bc5007249d75e720bbcdf.tar.bz2 plan9port-912fba95e74c7631352bc5007249d75e720bbcdf.zip |
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.)
Diffstat (limited to 'src/lib9')
-rw-r--r-- | src/lib9/await.c | 2 | ||||
-rw-r--r-- | src/lib9/dirread.c | 13 | ||||
-rw-r--r-- | src/lib9/ffork-pthread.c | 4 | ||||
-rw-r--r-- | src/lib9/mkfile | 1 | ||||
-rw-r--r-- | src/lib9/tas-PowerMacintosh.c | 4 |
5 files changed, 14 insertions, 10 deletions
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 <signal.h> #include <sys/types.h> +#include <sys/time.h> #include <sys/resource.h> #include <sys/wait.h> -#include <sys/time.h> 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 <lib9.h> +#define NOPLAN9DEFINES +#include <u.h> +#include <libc.h> #include <pthread.h> 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; } |