Frage

I'm trying to understand this line from an strace on linux:

sendto(10, "\24\0\0\0\26\0\1\3\233\274\362O\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20

I have looked on the net and in man pages about sendto, but I see no reference of pid and groups. event AF_NETLINK is not mentioned.

What do the pid and groups arguments mean? Where can I find the right doc about this function?

Thanks

War es hilfreich?

Lösung

That argument is a struct sockaddr *, as per the sendto manual page. When used with netlink sockets, it's actually a struct sockaddr_nl:

struct sockaddr_nl {
       sa_family_t     nl_family;  /* AF_NETLINK */
       unsigned short  nl_pad;     /* Zero. */
       pid_t           nl_pid;     /* Process ID. */
       __u32           nl_groups;  /* Multicast groups mask. */
};

So that's where the pid and groups must be coming from (the "Address Formats" section of the manual explains those fields).

Andere Tipps

The right doc is man 7 netlink but netlink does a lot of obscure stuff that isn't extremely well documented so good luck.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top