4 #include <sys/socket.h>
10 const char *SPATH
= "/tmp/vgtest-foofrob";
15 unlink (SPATH
); /* Make sure socket path doesn't exist yet. */
17 socket_fd
= socket(AF_UNIX
, SOCK_STREAM
, 0);
18 fprintf (stderr
, "Open socket %d\n", socket_fd
);
19 struct sockaddr_un my_addr
;
21 memset(&my_addr
, 0, sizeof(my_addr
));
22 my_addr
.sun_family
= AF_UNIX
;
23 strncpy(my_addr
.sun_path
, SPATH
, sizeof(my_addr
.sun_path
) - 1);
24 bind(socket_fd
, (struct sockaddr
*) &my_addr
, sizeof(my_addr
));
35 fprintf(stderr
, "close socket_fd %d\n", socket_fd
);
39 fprintf (stderr
, "and close the socket again %d\n", socket_fd
);