commit - 2db9e4821d8ae4889e63e5bb205b04eccb7af405
commit + 912fba95e74c7631352bc5007249d75e720bbcdf
blob - 6066543e5fc8a6f313741c82283cf859e284ed19
blob + e76fdb0ad33e909bebd9df3ef9bd2e2b760b163c
--- src/cmd/rm.c
+++ src/cmd/rm.c
char errbuf[ERRMAX];
int ignerr = 0;
-void
+static void
err(char *f)
{
if(!ignerr){
blob - 5ba8a61497298d6b4ac732edddda33df530df783
blob + 7e824da17e7b67f44de620d9c7d19ee15429462a
--- src/cmd/sam/sam.h
+++ src/cmd/sam/sam.h
#define TRUE 1
#define FALSE 0
+#undef INFINITY /* Darwin declares this as HUGE_VAL */
#define INFINITY 0x7FFFFFFFL
#define INCR 25
#define STRSIZE (2*BLOCKSIZE)
blob - a6b9a60e05eac750cd88a210f7639682b6f2dc76
blob + ba64daf03309614eba8148952527b589ee52f90f
--- src/cmd/samterm/mkfile
+++ src/cmd/samterm/mkfile
LDFLAGS=$LDFLAGS -lframe -ldraw -lthread -l9 -lregexp9 \
-lbio -lfmt -lutf -L$X11/lib -lX11 -lm
-o.samterm: $PLAN9/lib/libdraw.a
+o.samterm: $PLAN9/lib/libframe.a $PLAN9/lib/libdraw.a $PLAN9/lib/libthread.a
<$PLAN9/src/mkone
blob - e459bcf3f4191789e83048104af196bf3321355a
blob + f12f08502625ebc5f69183752ced8a3e1332c4d7
--- src/cmd/samterm/plan9.c
+++ src/cmd/samterm/plan9.c
static char *exname;
+#define STACK 8192
+
void
getscreen(int argc, char **argv)
{
plumbc = chancreate(sizeof(int), 0);
arg[0] = plumbc;
arg[1] = (void*)fd;
- proccreate(extproc, arg, 8192);
+ proccreate(extproc, arg, STACK);
atexit(removeextern);
}
}
arg[0] =plumbc;
arg[1] = &fd;
- proccreate(plumbproc, arg, 4096);
+ proccreate(plumbproc, arg, STACK);
return 1;
}
#endif
hoststart(void)
{
hostc = chancreate(sizeof(int), 0);
- proccreate(hostproc, hostc, 1024);
+ proccreate(hostproc, hostc, STACK);
}
blob - e899ef3fb523acc626b8cf29f88fc71aee5172a2
blob + 7a3e9f2f09d49dd157328b6b4a6394fe56042aa5
--- src/cmd/venti/mkfile
+++ src/cmd/venti/mkfile
<$PLAN9/src/mkmany
$SLIB: $LIBOFILES
- ar rvc $SLIB $LIBOFILES
+ $AR rvc $SLIB $LIBOFILES
# xml.c:D: mkxml dat.h
# ./mkxml dat.h > xml.c
blob - 56d79b79fbd371955af5fa984e2c9ec04c1e356c
blob + 89c695ae172305087ae1801140ee1b19ff13f080
--- src/lib9/await.c
+++ src/lib9/await.c
#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;
blob - 359b09ec1ece7a1eb775451d06bda51171871626
blob + 2e1ce886e41d1b863ffc13822460d326c3c85dac
--- src/lib9/dirread.c
+++ src/lib9/dirread.c
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);
seek(fd, off, 0);
return nn;
}
-#endif
static int
countde(char *p, int n)
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;
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;
blob - 189ac94f1cfa816bb255fe000fdf22e564b5dbe4
blob + 397f8aa6c1b2fdf2410f6ab84cc8b9396b7608df
--- src/lib9/ffork-pthread.c
+++ src/lib9/ffork-pthread.c
-#include <lib9.h>
+#define NOPLAN9DEFINES
+#include <u.h>
+#include <libc.h>
#include <pthread.h>
extern int __isthreaded;
blob - deb692490913d172c7408da2cf45d1121ae36d52
blob + a34cdc6992c6d83869dc5cea9a9bf3c51f9e2d19
--- src/lib9/mkfile
+++ src/lib9/mkfile
getuser.$O\
getwd.$O\
jmp.$O\
- jmp-$SYSNAME.$O\
lock.$O\
main.$O\
malloctag.$O\
blob - 29928ce0b62eb518fb068e4149c523f136908ced
blob + d7a8610c10577319dc389b913795da9bbfa03190
--- src/lib9/tas-PowerMacintosh.c
+++ src/lib9/tas-PowerMacintosh.c
* r3 contains return value upon return.
*/
int
-_tas(void *x)
+_tas(int *x)
{
int v;
/*
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;
}
blob - 7c5e9371f6af4723e673e3ee935c02bc0deeb733
blob + 4dbe2d45686bde9d6f5be222abd2ded77913a159
--- src/libdraw/mkfile
+++ src/libdraw/mkfile
<$PLAN9/src/mksyslib
-test: test.o $LIB
- gcc -o test test.o -L$PLAN9 -ldraw -l9 -lfmt -lutf -L$X11/lib -lX11 -lm
+test: test.o $PLAN9/lib/$LIB
+ gcc -o test test.o -L$PLAN9/lib -ldraw -l9 -lfmt -lutf -L$X11/lib -lX11 -lm
blob - 384f23fd01d78ce9028d12f0ae6cf0fda9bb2c8d
blob + d1ec298517aff1d2e3700e21ca3f3ff9916f4630
--- src/libthread/channel.c
+++ src/libthread/channel.c
{
int i;
- _threaddebug(DBGCHAN, "Queuing alt %p on channel %p", a, a->c);
+ _threaddebug(DBGCHAN, "Queueing alt %p on channel %p", a, a->c);
a->tag = c;
i = emptyentry(a->c);
a->c->qentry[i] = a;
blob - 5a37e34cbd7c68adee2acb94da20ab8feab03d3e
blob + ef50bf198e07766922459e71095027eb28da0f41
--- src/libthread/exec-unix.c
+++ src/libthread/exec-unix.c
if(p->threads.head != t || p->threads.head->nextt != nil){
werrstr("not only thread in proc");
Bad:
+ _threaddebug(DBGEXEC, "procexec bad %r");
if(pidc)
sendul(pidc, ~0);
return;
*/
if(pipe(p->exec.fd) < 0)
goto Bad;
+ if(fcntl(p->exec.fd[0], F_SETFD, 1) < 0)
+ goto Bad;
if(fcntl(p->exec.fd[1], F_SETFD, 1) < 0)
goto Bad;
if(pidc)
sendul(pidc, t->ret);
+ _threaddebug(DBGEXEC, "procexec schedexecwait");
/* wait for exec'ed program, then exit */
_schedexecwait();
}
Execargs *e;
e = ve;
- _threaddebug(DBGEXEC, "_schedexec %s", e->prog);
- close(e->fd[0]);
+ _threaddebug(DBGEXEC, "_schedexec %s -- calling execv", e->prog);
execv(e->prog, e->args);
_threaddebug(DBGEXEC, "_schedexec failed: %r");
rerrstr(buf, sizeof buf);
int
_schedexec(Execargs *e)
{
- return ffork(RFFDG|RFPROC|RFMEM, efork, e);
+ int pid;
+
+ pid = fork();
+ if(pid == 0){
+ efork(e);
+ _exit(1);
+ }
+ return pid;
}
blob - 62b825b5eeaa12a6f491c20359b13a6390d2910a
blob + 70eb0ae8bf1c3b78be0a31c36e36187a58a0a27c
--- src/libthread/rendez.c
+++ src/libthread/rendez.c
t->rendval = val;
t->rendhash = *l;
*l = t;
- t->nextstate = Rendezvous;
++nrendez;
if(nrendez > _threadhighnrendez)
_threadhighnrendez = nrendez;
- _threaddebug(DBGREND, "Rendezvous for tag %lud", t->rendtag);
+ _threaddebug(DBGREND, "Rendezvous for tag %lud (m=%d)", t->rendtag, t->moribund);
unlock(&_threadrgrp.lock);
+ t->nextstate = Rendezvous;
_sched();
t->inrendez = 0;
_threaddebug(DBGREND, "Woke after rendezvous; val is %lud", t->rendval);
blob - f1fde971ee51fb854fd3fa55c73ea8096d3ca4eb
blob + d33587fcd26b761f8c650c98599861e1e04802fc
--- src/libthread/sched.c
+++ src/libthread/sched.c
if((t=p->thread) != nil){
p->thread = nil;
if(t->moribund){
+ if(t->moribund != 1)
+ fprint(2, "moribund %d\n", t->moribund);
assert(t->moribund == 1);
t->state = Dead;
if(t->prevt)
blob - 3b0384e0d66dbe76edb10768cbacc2d7e27e7cd2
blob + cbb0569fb3a395adaaef0cad7e0c301360edb329
--- src/mkhdr
+++ src/mkhdr
CC=9c
LD=9l
AS=9a
+AR=9ar
CFLAGS=
LDFLAGS=
AFLAGS=
blob - 9f0b5df6cb62ff171f971857f678122d3ec0648f
blob + fab443d31a80d1ae6b8a56272f656f5dfb50580c
--- src/mksyslib
+++ src/mksyslib
default:V: $PLAN9/lib/$LIB
$PLAN9/lib/$LIB:V: $OFILES # force archive even when not needed
- ar rvc $PLAN9/lib/$LIB $newprereq
+ $AR rvc $PLAN9/lib/$LIB $newprereq
&:n: &.$O
- ar rvc $LIB $stem.$O
+ $AR rvc $PLAN9/lib/$LIB $stem.$O
all install:V: $PLAN9/lib/$LIB