1 #include <sys/socket.h>
8 #define VSYS_BMSOCKET "/vsys/fd_bmsocket.control"
10 int socket(int domain, int type, int protocol)
13 struct sockaddr_un addr;
16 sfd = socket(AF_UNIX, SOCK_STREAM, 0);
18 perror("Could not create UNIX socket\n");
22 memset(&addr, 0, sizeof(struct sockaddr_un));
24 addr.sun_family = AF_UNIX;
25 strncpy(addr.sun_path, VSYS_BMSOCKET,
26 sizeof(addr.sun_path) - 1);
28 if (connect(sfd, (struct sockaddr *) &addr,
29 sizeof(struct sockaddr_un)) == -1) {
30 perror("Could not connect to Vsys control socket");
35 remotefd = receive_fd(sfd);