getpeereid man page on Minix

Man page or keyword search:  
man Server   6208 pages
apropos Keyword Search (all sections)
Output format
Minix logo
[printable version]

GETPEEREID(2)							 GETPEEREID(2)

NAME
       getpeereid - get the effective user ID and effective group ID of a peer
       connected through a Unix domain socket.

SYNOPSIS
       #include <sys/socket.h>

       int getpeereid(int sd, uid_t *euid, gid_t *egid);

DESCRIPTION
       getpeereid() is often used to  authenticate  clients  connecting	 to  a
       server  through a Unix domain socket. The server can call this function
       with a socket descriptor sd and this function  will  fill-in  euid  and
       egid  with  the	effective  user	 ID  and the effective group ID of the
       client process.

RETURN VALUES
       On success, this function returns 0, euid is set to the effective  user
       ID of the peer connected through Unix domain socket sd, and egid is set
       to the effective group ID of the peer  connected	 through  Unix	domain
       socket sd. On error, -1 is returned and errno is set.

ERRORS
       [EBADF]	      The argument sd is not a descriptor.

       [ENOTSOCK]     The  argument  sd	 is  a	descriptor,  but  not a socket
		      descriptor.

       [EFAULT]	      The address pointed to by euid and/or egid is not	 in  a
		      valid part of the process address space.

SEE ALSO
       socket(2), socketpair(2), unix(8)

HISTORY
       This function first appeared in Minix 3.1.8.

								 GETPEEREID(2)
[top]

List of man pages available for Minix

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net