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