Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
c6810e76
Commit
c6810e76
authored
Mar 23, 2011
by
Albert Strasheim
Committed by
Russ Cox
Mar 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall: GetsockoptInt.
R=rsc, iant CC=golang-dev
https://golang.org/cl/4271060
parent
f2483c74
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
4 deletions
+33
-4
src/pkg/syscall/syscall_linux.go
src/pkg/syscall/syscall_linux.go
+7
-1
src/pkg/syscall/syscall_linux_386.go
src/pkg/syscall/syscall_linux_386.go
+5
-0
src/pkg/syscall/syscall_linux_amd64.go
src/pkg/syscall/syscall_linux_amd64.go
+1
-0
src/pkg/syscall/syscall_linux_arm.go
src/pkg/syscall/syscall_linux_arm.go
+1
-0
src/pkg/syscall/zsyscall_linux_386.go
src/pkg/syscall/zsyscall_linux_386.go
+1
-1
src/pkg/syscall/zsyscall_linux_amd64.go
src/pkg/syscall/zsyscall_linux_amd64.go
+9
-1
src/pkg/syscall/zsyscall_linux_arm.go
src/pkg/syscall/zsyscall_linux_arm.go
+9
-1
No files found.
src/pkg/syscall/syscall_linux.go
View file @
c6810e76
...
@@ -415,6 +415,13 @@ func Socketpair(domain, typ, proto int) (fd [2]int, errno int) {
...
@@ -415,6 +415,13 @@ func Socketpair(domain, typ, proto int) (fd [2]int, errno int) {
return
return
}
}
func
GetsockoptInt
(
fd
,
level
,
opt
int
)
(
value
,
errno
int
)
{
var
n
int32
vallen
:=
_Socklen
(
4
)
errno
=
getsockopt
(
fd
,
level
,
opt
,
uintptr
(
unsafe
.
Pointer
(
&
n
)),
&
vallen
)
return
int
(
n
),
errno
}
func
SetsockoptInt
(
fd
,
level
,
opt
int
,
value
int
)
(
errno
int
)
{
func
SetsockoptInt
(
fd
,
level
,
opt
int
,
value
int
)
(
errno
int
)
{
var
n
=
int32
(
value
)
var
n
=
int32
(
value
)
return
setsockopt
(
fd
,
level
,
opt
,
uintptr
(
unsafe
.
Pointer
(
&
n
)),
4
)
return
setsockopt
(
fd
,
level
,
opt
,
uintptr
(
unsafe
.
Pointer
(
&
n
)),
4
)
...
@@ -675,7 +682,6 @@ func Reboot(cmd int) (errno int) {
...
@@ -675,7 +682,6 @@ func Reboot(cmd int) (errno int) {
// Sendto
// Sendto
// Recvfrom
// Recvfrom
// Socketpair
// Socketpair
// Getsockopt
/*
/*
* Direct access
* Direct access
...
...
src/pkg/syscall/syscall_linux_386.go
View file @
c6810e76
...
@@ -130,6 +130,11 @@ func socket(domain int, typ int, proto int) (fd int, errno int) {
...
@@ -130,6 +130,11 @@ func socket(domain int, typ int, proto int) (fd int, errno int) {
return
return
}
}
func
getsockopt
(
s
int
,
level
int
,
name
int
,
val
uintptr
,
vallen
*
_Socklen
)
(
errno
int
)
{
_
,
errno
=
socketcall
(
_GETSOCKOPT
,
uintptr
(
s
),
uintptr
(
level
),
uintptr
(
name
),
uintptr
(
val
),
uintptr
(
unsafe
.
Pointer
(
vallen
)),
0
)
return
}
func
setsockopt
(
s
int
,
level
int
,
name
int
,
val
uintptr
,
vallen
int
)
(
errno
int
)
{
func
setsockopt
(
s
int
,
level
int
,
name
int
,
val
uintptr
,
vallen
int
)
(
errno
int
)
{
_
,
errno
=
socketcall
(
_SETSOCKOPT
,
uintptr
(
s
),
uintptr
(
level
),
uintptr
(
name
),
uintptr
(
val
),
uintptr
(
vallen
),
0
)
_
,
errno
=
socketcall
(
_SETSOCKOPT
,
uintptr
(
s
),
uintptr
(
level
),
uintptr
(
name
),
uintptr
(
val
),
uintptr
(
vallen
),
0
)
return
return
...
...
src/pkg/syscall/syscall_linux_amd64.go
View file @
c6810e76
...
@@ -40,6 +40,7 @@ package syscall
...
@@ -40,6 +40,7 @@ package syscall
//sys connect(s int, addr uintptr, addrlen _Socklen) (errno int)
//sys connect(s int, addr uintptr, addrlen _Socklen) (errno int)
//sysnb getgroups(n int, list *_Gid_t) (nn int, errno int)
//sysnb getgroups(n int, list *_Gid_t) (nn int, errno int)
//sysnb setgroups(n int, list *_Gid_t) (errno int)
//sysnb setgroups(n int, list *_Gid_t) (errno int)
//sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int)
//sys setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int)
//sys setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int)
//sysnb socket(domain int, typ int, proto int) (fd int, errno int)
//sysnb socket(domain int, typ int, proto int) (fd int, errno int)
//sysnb socketpair(domain int, typ int, proto int, fd *[2]int) (errno int)
//sysnb socketpair(domain int, typ int, proto int, fd *[2]int) (errno int)
...
...
src/pkg/syscall/syscall_linux_arm.go
View file @
c6810e76
...
@@ -57,6 +57,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, errno int)
...
@@ -57,6 +57,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, errno int)
//sys connect(s int, addr uintptr, addrlen _Socklen) (errno int)
//sys connect(s int, addr uintptr, addrlen _Socklen) (errno int)
//sysnb getgroups(n int, list *_Gid_t) (nn int, errno int) = SYS_GETGROUPS32
//sysnb getgroups(n int, list *_Gid_t) (nn int, errno int) = SYS_GETGROUPS32
//sysnb setgroups(n int, list *_Gid_t) (errno int) = SYS_SETGROUPS32
//sysnb setgroups(n int, list *_Gid_t) (errno int) = SYS_SETGROUPS32
//sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (errno int)
//sys setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int)
//sys setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int)
//sysnb socket(domain int, typ int, proto int) (fd int, errno int)
//sysnb socket(domain int, typ int, proto int) (fd int, errno int)
//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int)
//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int)
...
...
src/pkg/syscall/zsyscall_linux_386.go
View file @
c6810e76
// mksyscall.
sh
-l32 syscall_linux.go syscall_linux_386.go
// mksyscall.
pl
-l32 syscall_linux.go syscall_linux_386.go
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
package
syscall
package
syscall
...
...
src/pkg/syscall/zsyscall_linux_amd64.go
View file @
c6810e76
// mksyscall.
sh
syscall_linux.go syscall_linux_amd64.go
// mksyscall.
pl
syscall_linux.go syscall_linux_amd64.go
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
package
syscall
package
syscall
...
@@ -1072,6 +1072,14 @@ func setgroups(n int, list *_Gid_t) (errno int) {
...
@@ -1072,6 +1072,14 @@ func setgroups(n int, list *_Gid_t) (errno int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func
getsockopt
(
s
int
,
level
int
,
name
int
,
val
uintptr
,
vallen
*
_Socklen
)
(
errno
int
)
{
_
,
_
,
e1
:=
Syscall6
(
SYS_GETSOCKOPT
,
uintptr
(
s
),
uintptr
(
level
),
uintptr
(
name
),
uintptr
(
val
),
uintptr
(
unsafe
.
Pointer
(
vallen
)),
0
)
errno
=
int
(
e1
)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func
setsockopt
(
s
int
,
level
int
,
name
int
,
val
uintptr
,
vallen
int
)
(
errno
int
)
{
func
setsockopt
(
s
int
,
level
int
,
name
int
,
val
uintptr
,
vallen
int
)
(
errno
int
)
{
_
,
_
,
e1
:=
Syscall6
(
SYS_SETSOCKOPT
,
uintptr
(
s
),
uintptr
(
level
),
uintptr
(
name
),
uintptr
(
val
),
uintptr
(
vallen
),
0
)
_
,
_
,
e1
:=
Syscall6
(
SYS_SETSOCKOPT
,
uintptr
(
s
),
uintptr
(
level
),
uintptr
(
name
),
uintptr
(
val
),
uintptr
(
vallen
),
0
)
errno
=
int
(
e1
)
errno
=
int
(
e1
)
...
...
src/pkg/syscall/zsyscall_linux_arm.go
View file @
c6810e76
// mksyscall.
sh
-b32 syscall_linux.go syscall_linux_arm.go
// mksyscall.
pl
-b32 syscall_linux.go syscall_linux_arm.go
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
package
syscall
package
syscall
...
@@ -807,6 +807,14 @@ func setgroups(n int, list *_Gid_t) (errno int) {
...
@@ -807,6 +807,14 @@ func setgroups(n int, list *_Gid_t) (errno int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func
getsockopt
(
s
int
,
level
int
,
name
int
,
val
uintptr
,
vallen
*
_Socklen
)
(
errno
int
)
{
_
,
_
,
e1
:=
Syscall6
(
SYS_GETSOCKOPT
,
uintptr
(
s
),
uintptr
(
level
),
uintptr
(
name
),
uintptr
(
val
),
uintptr
(
unsafe
.
Pointer
(
vallen
)),
0
)
errno
=
int
(
e1
)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func
setsockopt
(
s
int
,
level
int
,
name
int
,
val
uintptr
,
vallen
int
)
(
errno
int
)
{
func
setsockopt
(
s
int
,
level
int
,
name
int
,
val
uintptr
,
vallen
int
)
(
errno
int
)
{
_
,
_
,
e1
:=
Syscall6
(
SYS_SETSOCKOPT
,
uintptr
(
s
),
uintptr
(
level
),
uintptr
(
name
),
uintptr
(
val
),
uintptr
(
vallen
),
0
)
_
,
_
,
e1
:=
Syscall6
(
SYS_SETSOCKOPT
,
uintptr
(
s
),
uintptr
(
level
),
uintptr
(
name
),
uintptr
(
val
),
uintptr
(
vallen
),
0
)
errno
=
int
(
e1
)
errno
=
int
(
e1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment