active.exiting = 0;
}
-/*
- * Put a string on the console.
- */
-void
-puts(char *s, int n)
-{
- print("%.*s", n, s);
-}
-
-void
-prflush(void)
-{
-}
-
-/*
- * Print a string on the console.
- */
-void
-putstrn(char *str, int n)
-{
- puts(str, n);
-}
-
-/*
- * get a character from the console
- */
-int
-getc(void)
-{
- return Bgetrune(&bin);
-}
-
void
panic(char *fmt, ...)
{
if(pipe(p) < 0)
panic("can't make a pipe");
snprint(buf, sizeof(buf), "#s/%s.cmd", service);
- srvfd(buf, 0220, p[0]);
+ srvfd(buf, 0660, p[0]);
close(p[0]);
/* use it as stdin */
}
/*
- * compute BUFSIZE*(NDBLOCK+INDPERBUF+INDPERBUFâ\81²+INDPERBUFâ\81³+INDPERBUFâ\81´)
+ * compute BUFSIZE*(NDBLOCK+INDPERBUF+INDPERBUF²+INDPERBUF³+INDPERBUFâ\81´)
* while watching for overflow; in that case, return 0.
*/
}
enum {
- INDPERBUF = ((uvlong)INDPERBUF *INDPERBUF),
- INDPERBUF⁴ = ((uvlong)INDPERBUFâ\81²*INDPERBUFâ\81²),
+ INDPERBUF² = ((uvlong)INDPERBUF*INDPERBUF),
+ INDPERBUF⁴ = ((uvlong)INDPERBUF²*INDPERBUF²),
};
static void
max = offlim - 1;
print("max file size = %,llud\n", (Wideoff)max);
}
- if (INDPERBUFâ\81²/INDPERBUF != INDPERBUF)
- print("overflow computing INDPERBUFâ\81²\n");
- if (INDPERBUF⁴/INDPERBUFâ\81² != INDPERBUFâ\81²)
+ if (INDPERBUF²/INDPERBUF != INDPERBUF)
+ print("overflow computing INDPERBUF²\n");
+ if (INDPERBUF⁴/INDPERBUF² != INDPERBUF²)
print("overflow computing INDPERBUF⁴\n");
print("\tINDPERBUF = %d, INDPERBUF^4 = %,lld, ", INDPERBUF,
(Wideoff)INDPERBUF⁴);
printsizes();
}
- qlock(&reflock);
- qunlock(&reflock);
serveq = newqueue(1000, "9P service"); /* tunable */
raheadq = newqueue(1000, "readahead"); /* tunable */
Msgbuf *mb;
for (;;) {
- qlock(&reflock);
/* read 9P request from a network input process */
mb = fs_recv(serveq, 0);
assert(mb->magic == Mbmagic);
if (cp == nil)
panic("serve: nil mb->chan");
rlock(&cp->reflock);
- qunlock(&reflock);
rlock(&mainlock);
break;
}
if(cp->protocol == nil && (chatty > 1)){
- print("no protocol for message\n");
+ fprint(2, "no protocol for message\n");
hexdump(mb->data, 12);
}
} else
active.exiting = 1;
unlock(&active);
- print("halted at %T.\n", time(nil));
+ fprint(2, "halted at %T.\n", time(nil));
postnote(PNGROUP, getpid(), "die");
exits(nil);
}
Timet nddate = nextime(t+MINUTE(100), DUMPTIME, WEEKMASK);
if(!conf.nodump && chatty)
- print("next dump at %T\n", nddate);
+ fprint(2, "next dump at %T\n", nddate);
return nddate;
}
ntoytime = time(nil) + HOUR(1);
else if(t > nddate) {
if(!conf.nodump) {
- print("automatic dump %T\n", t);
+ fprint(2, "automatic dump %T\n", t);
for(fs=filsys; fs->name; fs++)
if(fs->dev->type == Devcw)
cfsdump(fs);