Getpeereid

getpeereid lets one check the credentials of a UNIX socket connected to another UNIX socket. Very handy inside a multi-user system.