syscall: use correct pointer in recvfrom/sendto.

linux/386 stack trace: use 32-bit hex.

Fixes #159.

R=r
https://golang.org/cl/154178
This commit is contained in:
Russ Cox 2009-11-17 08:39:04 -08:00
parent 152bfa03d8
commit a65bf95dd8
2 changed files with 15 additions and 15 deletions

View file

@ -125,7 +125,7 @@ func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int)
func recvfrom(s int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
var base uintptr;
if len(p) > 0 {
base = uintptr(unsafe.Pointer(&p))
base = uintptr(unsafe.Pointer(&p[0]))
}
n, errno = socketcall(_RECVFROM, uintptr(s), base, uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)));
return;
@ -134,7 +134,7 @@ func recvfrom(s int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockle
func sendto(s int, p []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
var base uintptr;
if len(p) > 0 {
base = uintptr(unsafe.Pointer(&p))
base = uintptr(unsafe.Pointer(&p[0]))
}
_, errno = socketcall(_SENDTO, uintptr(s), base, uintptr(len(p)), uintptr(flags), to, uintptr(addrlen));
return;