Source file
src/os/user/cgo_lookup_cgo.go
1
2
3
4
5
6
7 package user
8
9 import (
10 "syscall"
11 )
12
13
59 import "C"
60
61 type _C_char = C.char
62 type _C_int = C.int
63 type _C_gid_t = C.gid_t
64 type _C_uid_t = C.uid_t
65 type _C_size_t = C.size_t
66 type _C_struct_group = C.struct_group
67 type _C_struct_passwd = C.struct_passwd
68 type _C_long = C.long
69
70 func _C_pw_uid(p *_C_struct_passwd) _C_uid_t { return p.pw_uid }
71 func _C_pw_uidp(p *_C_struct_passwd) *_C_uid_t { return &p.pw_uid }
72 func _C_pw_gid(p *_C_struct_passwd) _C_gid_t { return p.pw_gid }
73 func _C_pw_gidp(p *_C_struct_passwd) *_C_gid_t { return &p.pw_gid }
74 func _C_pw_name(p *_C_struct_passwd) *_C_char { return p.pw_name }
75 func _C_pw_gecos(p *_C_struct_passwd) *_C_char { return p.pw_gecos }
76 func _C_pw_dir(p *_C_struct_passwd) *_C_char { return p.pw_dir }
77
78 func _C_gr_gid(g *_C_struct_group) _C_gid_t { return g.gr_gid }
79 func _C_gr_name(g *_C_struct_group) *_C_char { return g.gr_name }
80
81 func _C_GoString(p *_C_char) string { return C.GoString(p) }
82
83 func _C_getpwnam_r(name *_C_char, buf *_C_char, size _C_size_t) (pwd _C_struct_passwd, found bool, errno syscall.Errno) {
84 var f, e _C_int
85 pwd = C.mygetpwnam_r(name, buf, size, &f, &e)
86 return pwd, f != 0, syscall.Errno(e)
87 }
88
89 func _C_getpwuid_r(uid _C_uid_t, buf *_C_char, size _C_size_t) (pwd _C_struct_passwd, found bool, errno syscall.Errno) {
90 var f, e _C_int
91 pwd = C.mygetpwuid_r(_C_int(uid), buf, size, &f, &e)
92 return pwd, f != 0, syscall.Errno(e)
93 }
94
95 func _C_getgrnam_r(name *_C_char, buf *_C_char, size _C_size_t) (grp _C_struct_group, found bool, errno syscall.Errno) {
96 var f, e _C_int
97 grp = C.mygetgrnam_r(name, buf, size, &f, &e)
98 return grp, f != 0, syscall.Errno(e)
99 }
100
101 func _C_getgrgid_r(gid _C_gid_t, buf *_C_char, size _C_size_t) (grp _C_struct_group, found bool, errno syscall.Errno) {
102 var f, e _C_int
103 grp = C.mygetgrgid_r(_C_int(gid), buf, size, &f, &e)
104 return grp, f != 0, syscall.Errno(e)
105 }
106
107 const (
108 _C__SC_GETPW_R_SIZE_MAX = C._SC_GETPW_R_SIZE_MAX
109 _C__SC_GETGR_R_SIZE_MAX = C._SC_GETGR_R_SIZE_MAX
110 )
111
112 func _C_sysconf(key _C_int) _C_long { return C.sysconf(key) }
113
View as plain text