openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/systemd/1_242+AUTOINC+db2e367bfc-r0/git/src/libsystemd/sd-netlink/netlink-socket.c
int socket_write_message(sd_netlink* nl, sd_netlink_message* m)
{
    union
    {
        struct sockaddr sa;
        struct sockaddr_nl nl;
    } addr = {
        .nl.nl_family = AF_NETLINK,
    };
    ssize_t k;

    assert(nl);
    assert(m);
    assert(m->hdr);

    k = sendto(nl->fd, m->hdr, m->hdr->nlmsg_len, 0, &addr.sa, sizeof(addr));
    if (k < 0)
        return -errno;

    return k;
}
/* returns the number of bytes sent, or a negative error code */
returns the number of bytes sent, or a negative error code
returns the number of bytes sent or a negative error code
int socket_write_message(sd_netlink* nl, sd_netlink_message* m)
{
    union
    {
        struct sockaddr sa;
        struct sockaddr_nl nl;
    } addr = {
        .nl.nl_family = AF_NETLINK,
    };
    ssize_t k;
    assert(nl);
    assert(m);
    assert(m->hdr);
    k = sendto(nl->fd, m->hdr, m->hdr->nlmsg_len, 0, &addr.sa, sizeof(addr));
    if (k < 0)
        return -errno;
    return k;
}
int socket_write_message ( sd_netlink * nl , sd_netlink_message * m ) { union { struct sockaddr sa ; struct sockaddr_nl nl ; } addr = { . nl . nl_family = AF_NETLINK , } ; ssize_t k ; assert ( nl ) ; assert ( m ) ; assert ( m -> hdr ) ; k = sendto ( nl -> fd , m -> hdr , m -> hdr -> nlmsg_len , 0 , & addr . sa , sizeof ( addr ) ) ; if ( k < 0 ) return - errno ; return k ; }
returns the number of bytes sent, or a negative error code
returns the number of bytes sent or a negative error code