1 /* talkd.c Copyright Michael Temari 07/22/1996 All Rights Reserved */
7 #include <net/gen/in.h>
14 _PROTOTYPE(int main
, (int argc
, char *argv
[]));
17 char myhostname
[HOST_SIZE
+1];
23 struct talk_request request
;
24 struct talk_reply reply
;
27 if(strcmp(argv
[1], "-d") || argc
> 2) {
28 fprintf(stderr
, "Usage: talkd [-d]\n");
34 fprintf(stderr
, "talkd: Must be run as super user\n");
38 if(gethostname(myhostname
, HOST_SIZE
) < 0) {
39 fprintf(stderr
, "talkd: Error getting hostname\n");
44 fprintf(stderr
, "talkd: Error in NetInit\n");
48 while(getrequest(&request
) == 0) {
49 if(processrequest(&request
, &reply
)) break;
50 if(sendreply(&request
, &reply
)) break;