On Tue, Dec 31, 2002 at 08:40:16PM -0500, Jim Faucette wrote: > I'm trying to get a connecting process' PID that's using a UNIX socket. > recvmsg makes it appear possible, but so far no good. > > Has anyone done this before? Can you supply a code sippet???
In the FreeBSD implimentation, the sender must attach a message of type SCM_CREDS and the kernel will correctly fill in the fields. FreeBSD also supports a socketoption which returns a structure containing the credentials of the process at the far end. It is used to impliment getpeereid - have a look at: http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/gen/getpeereid.c?rev=1.4.2.2 for an example. David. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message