summaryrefslogtreecommitdiff
path: root/lib/sys/sys+openbsd-x64.myr
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2017-06-24 23:06:58 -0700
committerOri Bernstein <ori@eigenstate.org>2017-06-25 01:08:54 -0700
commitfb8cbb2339df748749c588b20f787e2973c2fd36 (patch)
tree82e5981b781c4fbc89482fc14ebd7091c06e73a2 /lib/sys/sys+openbsd-x64.myr
parentde496a920339b8285ca2e9225b1abff7af54698a (diff)
downloadmc-fb8cbb2339df748749c588b20f787e2973c2fd36.tar.gz
Rename Solsock to Solsocket and make it type sockproto
This constant is used as a protocol level in getsockopt/setsockopt as well as msghdr. Valid values for level include the same constants used as the protocol argument of socket (IPPROTO_*), so it needs to have the same type so the constants can be used in both functions. The rename is for consistency with the C API.
Diffstat (limited to 'lib/sys/sys+openbsd-x64.myr')
-rw-r--r--lib/sys/sys+openbsd-x64.myr9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/sys/sys+openbsd-x64.myr b/lib/sys/sys+openbsd-x64.myr
index b5d951a..8b4ffcf 100644
--- a/lib/sys/sys+openbsd-x64.myr
+++ b/lib/sys/sys+openbsd-x64.myr
@@ -239,8 +239,8 @@ pkg sys =
const Sockraw : socktype = 3
const Sockrdm : socktype = 4
const Sockseqpacket : socktype = 5
- const Solsock : socktype = 0xffff
+ /* socket options */
const Sodebug : sockopt = 0x0001 /* turn on debugging info recording */
const Soacceptconn : sockopt = 0x0002 /* socket has had listen() */
const Soreuseaddr : sockopt = 0x0004 /* allow local address reuse */
@@ -266,6 +266,9 @@ pkg sys =
const Sopeercred : sockopt = 0x1022 /* get connect-time credentials */
const Sosplice : sockopt = 0x1023 /* splice data to other socket */
+ /* socket option levels */
+ const Solsocket : sockproto = 0xffff
+
/* network protocols */
const Ipproto_ip : sockproto = 0
const Ipproto_icmp : sockproto = 1
@@ -603,8 +606,8 @@ pkg sys =
const accept : (sock : fd, addr : sockaddr#, len : size# -> fd)
const listen : (sock : fd, backlog : int -> int)
const bind : (sock : fd, addr : sockaddr#, len : size -> int)
- const setsockopt : (sock : fd, lev : socktype, opt : sockopt, val : void#, len : size -> int)
- const getsockopt : (sock : fd, lev : socktype, opt : sockopt, val : void#, len : size# -> int)
+ const setsockopt : (sock : fd, lev : sockproto, opt : sockopt, val : void#, len : size -> int)
+ const getsockopt : (sock : fd, lev : sockproto, opt : sockopt, val : void#, len : size# -> int)
/* memory mapping */
const munmap : (addr:byte#, len:size -> int64)