2 * $DragonFly: src/test/caps/server.c,v 1.5 2004/08/24 13:45:54 drhodus Exp $
14 main(int ac
, char **av
)
20 struct caps_msgid msgid
;
24 cid
= caps_sys_service("test", getuid(), getgid(), 0, CAPF_ANYCLIENT
);
26 perror("caps_sys_service");
29 printf("cid = %d\n", cid
);
32 bzero(&msgid
, sizeof(msgid
));
34 n
= caps_sys_wait(cid
, buf
, sizeof(buf
), &msgid
, NULL
);
36 printf("n = %d msgid=%016llx state=%d errno=%d\n", n
, msgid
.c_id
, msgid
.c_state
, errno
);
38 printf("BUFFER: %*.*s\n", n
, n
, buf
);
40 if (msgid
.c_state
!= CAPMS_DISPOSE
)
41 n
= caps_sys_reply(cid
, "good", 4, msgid
.c_id
);
43 printf("reply: n = %d\n", n
);
45 if (++count
% 1000000 == 0)
46 caps_sys_setgen(cid
, count
);