]> Zhao Yanbai Git Server - minix.git/blob - minix/man/man2/getnucred.2
31e317d469c5357de6b05e2315849ce9e5bb04da
[minix.git] / minix / man / man2 / getnucred.2
1 .TH GETNUCRED 2
2 .SH NAME
3 getnucred \- obtain the credentials that correspond to the given endpoint.
4 .SH SYNOPSIS
5 .ft B
6 #include <sys/socket.h>
7 .in +5
8 .ti -5
9 #include <sys/ucred.h>
10
11 .ti -5
12 int getnucred(endpoint_t \fIproc_ep\fP, struct uucred * \fIucred\fP);
13 .br
14 .ft P
15 .SH DESCRIPTION
16 Given an endpoint \fIproc_ep\fP, this function will fill in \fIucred\fP
17 with the \fIpid\fP, \fIuid\fP, and \fIgid\fP that correspond to that
18 endpoint.
19 .SH RETURN VALUES
20 On success, this function returns 0 and \fIucred\fP will be filled in.
21 On error, -1 is returned and \fIerrno\fP is set.
22 .SH ERRORS
23 .TP 15
24 [EFAULT]
25 The address pointed to by \fIucred\fP is not in a valid part of the
26 process address space.
27 [EPERM]
28 The user calling this function has insufficient privileges. Only a user
29 with an euid of 0 may call this function.
30 [ESRCH]
31 The endpoint was not found. This is caused by an invalid endpoint or an
32 endpoint for a process that no longer exists.
33 .SH SEE ALSO
34 .BR getpid(2),
35 .BR getuid(2),
36 .BR getgid(2),
37 .BR getnpid(2),
38 .BR getnuid(2),
39 .BR getngid(2)
40 .SH HISTORY
41 This function first appeared in Minix 3.1.8.