Commit a65bf95d authored by Russ Cox's avatar Russ Cox

syscall: use correct pointer in recvfrom/sendto.

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

Fixes #159.

R=r
https://golang.org/cl/154178
parent 152bfa03
......@@ -10,19 +10,19 @@
void
dumpregs(Sigcontext *r)
{
printf("eax %X\n", r->eax);
printf("ebx %X\n", r->ebx);
printf("ecx %X\n", r->ecx);
printf("edx %X\n", r->edx);
printf("edi %X\n", r->edi);
printf("esi %X\n", r->esi);
printf("ebp %X\n", r->ebp);
printf("esp %X\n", r->esp);
printf("eip %X\n", r->eip);
printf("eflags %X\n", r->eflags);
printf("cs %X\n", r->cs);
printf("fs %X\n", r->fs);
printf("gs %X\n", r->gs);
printf("eax %x\n", r->eax);
printf("ebx %x\n", r->ebx);
printf("ecx %x\n", r->ecx);
printf("edx %x\n", r->edx);
printf("edi %x\n", r->edi);
printf("esi %x\n", r->esi);
printf("ebp %x\n", r->ebp);
printf("esp %x\n", r->esp);
printf("eip %x\n", r->eip);
printf("eflags %x\n", r->eflags);
printf("cs %x\n", r->cs);
printf("fs %x\n", r->fs);
printf("gs %x\n", r->gs);
}
/*
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment