1 #include <sys/socket.h>
9 main(int argc, char *argv[])
12 struct sockaddr_un addr;
14 sfd = socket(AF_UNIX, SOCK_STREAM, 0);
20 memset(&addr, 0, sizeof(struct sockaddr_un));
22 addr.sun_family = AF_UNIX;
23 strncpy(addr.sun_path, argv[1],
24 sizeof(addr.sun_path) - 1);
26 if (connect(sfd, (struct sockaddr *) &addr,
27 sizeof(struct sockaddr_un)) == -1) {
32 printf("Connected\n");