2 * This file is licensed under the Creative Commons Zero License,
3 * version 1.0, available at
4 * http://creativecommons.org/publicdomain/zero/1.0/legalcode
9 #include <sys/socket.h>
17 int main(int argc, char *argv[])
19 static const char socket_name[] = "\0liveinfo";
20 struct sockaddr_un sun;
24 if (argv[1] == NULL) {
25 fprintf(stderr, "usage:\n%s \"label: value\"\n", argv[0]);
29 sock = socket(PF_UNIX, SOCK_DGRAM, 0);
31 perror("socket PF_UNIX");
35 memset(&sun, 0, sizeof(sun));
36 sun.sun_family = AF_UNIX;
37 memcpy(sun.sun_path, socket_name, sizeof(socket_name));
39 ret = sendto(sock, argv[1], strlen(argv[1]), 0,
40 (struct sockaddr *)&sun, sizeof(sun));