diff options
author | Russ Cox <rsc@golang.org> | 2009-11-01 11:13:27 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-11-01 11:13:27 -0800 |
commit | e553412f7d28715525607dcd86f48723bc28423b (patch) | |
tree | 865762db2f724d6fdba1bb99fd65b02ca56edd8b /src/pkg/syscall/zsyscall_darwin_386.go | |
parent | 70e1eeffd9a4848d9c31ce9945226cafd9273c60 (diff) | |
download | golang-e553412f7d28715525607dcd86f48723bc28423b.tar.gz |
syscall cleanup.
* rename PORT.sh -> mkall.sh (hopefully more obvious),
change behavior: run commands by default.
* pull more constants out of #defines automatically,
instead of editing large lists by hand.
* add Recvfrom, Sendto
add os.O_EXCL.
R=r
http://go/go-review/1017009
Diffstat (limited to 'src/pkg/syscall/zsyscall_darwin_386.go')
-rw-r--r-- | src/pkg/syscall/zsyscall_darwin_386.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/pkg/syscall/zsyscall_darwin_386.go b/src/pkg/syscall/zsyscall_darwin_386.go index 29c11f6a7..ea9ce955f 100644 --- a/src/pkg/syscall/zsyscall_darwin_386.go +++ b/src/pkg/syscall/zsyscall_darwin_386.go @@ -77,6 +77,27 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { return; } +func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) { + var _p0 *byte; + if len(p) > 0 { + _p0 = &p[0]; + } + r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))); + n = int(r0); + errno = int(e1); + return; +} + +func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) { + var _p0 *byte; + if len(buf) > 0 { + _p0 = &buf[0]; + } + _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)); + errno = int(e1); + return; +} + func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, errno int) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))); n = int(r0); |