]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: add ucred structure for SCM_CREDENTIALS over UNIX sockets.
authorAlbert Strasheim <fullung@gmail.com>
Wed, 6 Oct 2010 10:32:31 +0000 (21:32 +1100)
committerAndrew Gerrand <adg@golang.org>
Wed, 6 Oct 2010 10:32:31 +0000 (21:32 +1100)
Working on issue 1101.

R=golang-dev, rsc, adg
CC=golang-dev
https://golang.org/cl/2338042

src/pkg/syscall/types_linux.c [changed mode: 0644->0755]
src/pkg/syscall/ztypes_linux_386.go
src/pkg/syscall/ztypes_linux_amd64.go

old mode 100644 (file)
new mode 100755 (executable)
index d0cd4a1..7489bc9
@@ -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),
 };
 
 
index 53751529b9e39a0c62c066ec7a86bd510818bd11..99ce60819c8b58be44e9ff03350d5a358b42fc19 100644 (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
index 6a19a88a8085ad2999abe8c9fc9f8b7a4446c10f..3883a58aa0686f49cacd1263372cae2bae88729a 100644 (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