#include #include #include #include #include #include #include #include #define SOCK_PATH "/tmp/kissbot" int main(void) { struct sockaddr_un remote = {.sun_family = AF_UNIX}; int s = socket(AF_UNIX, SOCK_STREAM, 0); if (s == -1) err(1, "socket"); strlcpy(remote.sun_path, SOCK_PATH, sizeof(remote.sun_path)-1); if (connect(s, (struct sockaddr *)&remote, sizeof(SOCK_PATH) + sizeof(remote.sun_family)) == -1) err(1, "connect"); char msg[] = "Hi, test message 1!\n"; if (send(s, msg, sizeof(msg), 0) == -1) err(1, "send"); close(s); return 0; }