Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
3a971195
Commit
3a971195
authored
Jan 19, 2011
by
Albert Strasheim
Committed by
Russ Cox
Jan 19, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net, syscall: return source address in Recvmsg
R=rsc CC=golang-dev
https://golang.org/cl/3766042
parent
655da996
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
fd.go
src/pkg/net/fd.go
+1
-1
syscall_bsd.go
src/pkg/syscall/syscall_bsd.go
+2
-2
syscall_linux.go
src/pkg/syscall/syscall_linux.go
+5
-1
No files found.
src/pkg/net/fd.go
View file @
3a971195
...
...
@@ -417,7 +417,7 @@ func (fd *netFD) ReadMsg(p []byte, oob []byte) (n, oobn, flags int, sa syscall.S
var
oserr
os
.
Error
for
{
var
errno
int
n
,
oobn
,
flags
,
errno
=
syscall
.
Recvmsg
(
fd
.
sysfd
,
p
,
oob
,
sa
,
0
)
n
,
oobn
,
flags
,
sa
,
errno
=
syscall
.
Recvmsg
(
fd
.
sysfd
,
p
,
oob
,
0
)
if
errno
==
syscall
.
EAGAIN
&&
fd
.
rdeadline
>=
0
{
pollserver
.
WaitRead
(
fd
)
continue
...
...
src/pkg/syscall/syscall_bsd.go
View file @
3a971195
...
...
@@ -485,8 +485,8 @@ func Futimes(fd int, tv []Timeval) (errno int) {
//sys fcntl(fd int, cmd int, arg int) (val int, errno int)
func
Recvmsg
(
fd
int
,
p
,
oob
[]
byte
,
f
rom
Sockaddr
,
flags
int
)
(
n
,
oobn
int
,
recvflags
int
,
errno
int
)
{
return
0
,
0
,
0
,
EAFNOSUPPORT
func
Recvmsg
(
fd
int
,
p
,
oob
[]
byte
,
f
lags
int
)
(
n
,
oobn
int
,
recvflags
int
,
from
Sockaddr
,
errno
int
)
{
return
0
,
0
,
0
,
nil
,
EAFNOSUPPORT
}
func
Sendmsg
(
fd
int
,
p
,
oob
[]
byte
,
to
Sockaddr
,
flags
int
)
(
errno
int
)
{
...
...
src/pkg/syscall/syscall_linux.go
View file @
3a971195
...
...
@@ -450,7 +450,7 @@ func Sendto(fd int, p []byte, flags int, to Sockaddr) (errno int) {
return
sendto
(
fd
,
p
,
flags
,
ptr
,
n
)
}
func
Recvmsg
(
fd
int
,
p
,
oob
[]
byte
,
f
rom
Sockaddr
,
flags
int
)
(
n
,
oobn
int
,
recvflags
int
,
errno
int
)
{
func
Recvmsg
(
fd
int
,
p
,
oob
[]
byte
,
f
lags
int
)
(
n
,
oobn
int
,
recvflags
int
,
from
Sockaddr
,
errno
int
)
{
var
msg
Msghdr
var
rsa
RawSockaddrAny
msg
.
Name
=
(
*
byte
)(
unsafe
.
Pointer
(
&
rsa
))
...
...
@@ -477,6 +477,10 @@ func Recvmsg(fd int, p, oob []byte, from Sockaddr, flags int) (n, oobn int, recv
}
oobn
=
int
(
msg
.
Controllen
)
recvflags
=
int
(
msg
.
Flags
)
// source address is only specified if the socket is unconnected
if
rsa
.
Addr
.
Family
!=
0
{
from
,
errno
=
anyToSockaddr
(
&
rsa
)
}
return
}
...
...
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