shithub: mc

Download patch

ref: b9ac87f7822bb7d333d681a8dbe25b73acbb5844
parent: b9aedad0639309171cfff4cf6dddcdf0272372fb
author: Ori Bernstein <[email protected]>
date: Thu Oct 24 17:12:02 EDT 2013

Add some networking functions.

--- a/libstd/sys-osx.myr
+++ b/libstd/sys-osx.myr
@@ -524,7 +524,10 @@
 
 /* networking */
 const socket	= {dom, stype, proto;	-> syscall(Syssocket, dom castto(int64), stype, proto) castto(fd) }
-const connect	= {sock, addr, len;	-> syscall(Sysconnect, sock, addr, len) castto(fd)}
+const connect	= {sock, addr, len;	-> syscall(Sysconnect, sock, addr, len) castto(int)}
+const accept	= {sock, addr, len;	-> syscall(Sysaccept, sock, addr, len) castto(fd)}
+const listen	= {sock, backlog;	-> syscall(Syslisten, sock, backlog castto(int64)) castto(int)}
+const bind	= {sock, addr, len;	-> syscall(Sysbind, sock, addr, len) castto(int)}
 
 /* memory management */
 const munmap	= {addr, len;		-> syscall(Sysmunmap, addr, len)}