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