SO_PEERCRED is simple way to get pid/uid/gid of connected AF_UNIX stream socket, SCM_CREDENTIALS is more or less the same, but more complex (various ancillary messages). Links to example showing both ways.
- Why there are two ways to get more or less the same information?
- Why the more comfortable SO_PEERCRED is not listed in unix(7) manpage?
- Which is use more in real-life applicatins?
What should I use?