You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently most of the possible {{cmsghdr}} entries accept only binary, this is problematic as there is no way to safely encode for example {{pid_t}} in Erlang that would be platform independent. So the proposal is to allow passing "meaningful" data to such structure, such types would be:
* Map in form of {{#\{pid => integer(), uid => integer(), gid => integer()\}}} for {{credentials}} type
* List in form of {{[integer()]}} in case of {{rights}}
I haven't found what is the expected data in case of {{timestamp}} type. Without such constructs it make usage of {{socket:sendmsg}} pretty impossible without using NIFs.
The text was updated successfully, but these errors were encountered:
Ok, I have read a little bit about it and it is even a little bit more complex. In FreeBSD (and derivatives like macOS) it uses [different structure|https://github.com/freebsd/freebsd/blob/401e02f6005b2cbeb79c8a6ebaf412be79ff2775/tools/regression/sockets/unix_cmsg/t_cmsgcred.c#L43] (actually [two structs|https://github.com/freebsd/freebsd/blob/401e02f6005b2cbeb79c8a6ebaf412be79ff2775/tools/regression/sockets/unix_cmsg/t_sockcred.c#L43] depending on how the creds are sent) than [Linux|https://linux.die.net/man/7/unix]. So the only fields that are *guaranteed to be present* on both are {{uid}} and {{gid}}. I have no idea how to solve sending part, on receiving end we can just check which one is the arriving and decode respectively.
Original reporter:
hauleth
Affected version:
Not Specified
Component:
kernel
Migrated from: https://bugs.erlang.org/browse/ERL-1201
The text was updated successfully, but these errors were encountered: