File: trypeercred.c

package info (click to toggle)
ucspi-unix 1.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 452 kB
  • sloc: ansic: 2,606; python: 535; makefile: 14; sh: 1
file content (11 lines) | stat: -rw-r--r-- 215 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
#define _GNU_SOURCE 1
#include <sys/types.h>
#include <sys/socket.h>

int main(void)
{
  struct ucred peer;
  socklen_t optlen = sizeof(peer);
  getsockopt(0, SOL_SOCKET, SO_PEERCRED, &peer, &optlen);
  return 0;
}