1
0
mirror of https://github.com/golang/go synced 2024-11-21 22:14:41 -07:00

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
This commit is contained in:
Albert Strasheim 2010-10-06 21:32:31 +11:00 committed by Andrew Gerrand
parent c276ce98c2
commit 8b905489ab
3 changed files with 16 additions and 0 deletions

2
src/pkg/syscall/types_linux.c Normal file → Executable file
View File

@ -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),
};

View File

@ -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

View File

@ -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