Commit 8b905489 authored by Albert Strasheim's avatar Albert Strasheim Committed by Andrew Gerrand

syscall: add ucred structure for SCM_CREDENTIALS over UNIX sockets.

Working on issue 1101.

R=golang-dev, rsc, adg
CC=golang-dev
https://golang.org/cl/2338042
parent c276ce98
......@@ -108,6 +108,7 @@ typedef struct linger $Linger;
typedef struct iovec $Iovec;
typedef struct msghdr $Msghdr;
typedef struct cmsghdr $Cmsghdr;
typedef struct ucred $Ucred;
enum {
$SizeofSockaddrInet4 = sizeof(struct sockaddr_in),
......@@ -117,6 +118,7 @@ enum {
$SizeofLinger = sizeof(struct linger),
$SizeofMsghdr = sizeof(struct msghdr),
$SizeofCmsghdr = sizeof(struct cmsghdr),
$SizeofUcred = sizeof(struct ucred),
};
......
......@@ -19,6 +19,7 @@ const (
SizeofLinger = 0x8
SizeofMsghdr = 0x1c
SizeofCmsghdr = 0xc
SizeofUcred = 0xc
SizeofInotifyEvent = 0x10
)
......@@ -218,6 +219,12 @@ type Cmsghdr struct {
Type int32
}
type Ucred struct {
Pid int32
Uid uint32
Gid uint32
}
type InotifyEvent struct {
Wd int32
Mask uint32
......
......@@ -19,6 +19,7 @@ const (
SizeofLinger = 0x8
SizeofMsghdr = 0x38
SizeofCmsghdr = 0x10
SizeofUcred = 0xc
SizeofInotifyEvent = 0x10
)
......@@ -220,6 +221,12 @@ type Cmsghdr struct {
Type int32
}
type Ucred struct {
Pid int32
Uid uint32
Gid uint32
}
type InotifyEvent struct {
Wd int32
Mask uint32
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment