10 static char nbuf[NSIZE];
20 snprint(buf, sizeof buf, "/proc/%d/note", chatpid);
21 fd = open(buf, OWRITE);
22 write(fd, "kill\n", 5);
33 snprint(nbuf, sizeof nbuf, "/srv/%s", name);
35 if(p = strrchr(argv0, '/')) /* assign = */
39 snprint(nbuf, sizeof nbuf, "/srv/%s.chat", name);
43 panic("chatsrv pipe");
44 sfd = create(nbuf, OWRITE, 0600);
46 panic("chatsrv create %s", nbuf);
47 chatpid = rfork(RFPROC|RFMEM);
50 panic("chatsrv fork");
57 fprint(sfd, "%d", pfd[1]);
61 n = read(pfd[0], buf, sizeof(buf)-1);
69 chatty = strtol(buf, 0, 0);
73 rpcdebug = abs(chatty) - 1;
74 fprint(2, "%s: chatty=%d, rpcdebug=%d, conftime=%d\n",
75 nbuf, chatty, rpcdebug, conftime);
90 fmtfdinit(&f, 2, buf, sizeof buf);
92 fmtvprint(&f, fmt, arg);
105 vseprint(buf, buf+SIZE, fmt, arg);
108 if(chatty || rpcdebug)
111 if(n>0 && buf[n-1] == '\n')
113 syslog(0, "nfs", buf);
118 panic(char *fmt, ...)
124 vseprint(buf, buf+SIZE, fmt, arg);
126 if(chatty || rpcdebug)
127 fprint(2, "%s %d: %s: %r\n", argv0, getpid(), buf);
129 syslog(0, "nfs", buf);