13 #include <sys/types.h>
16 #ifdef HAVE_SYS_SOCKET_H
17 #include <sys/socket.h>
35 write_cb(
int fd,
short event,
void *arg)
37 const char *
test =
"test string";
40 len = write(fd, test, strlen(test) + 1);
42 printf(
"%s: write %d%s\n", __func__,
43 len, len ?
"" :
" - means EOF");
49 }
else if (called == 1)
56 main (
int argc,
char **argv)
61 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
65 if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
72 event_set(&ev, pair[1], EV_WRITE, write_cb, &ev);