summaryrefslogtreecommitdiff
path: root/lib/sys
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
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')
-rw-r--r--lib/sys/sys+freebsd-x64.myr8
-rw-r--r--lib/sys/sys+linux-x64.myr8
-rw-r--r--lib/sys/sys+netbsd-x64.myr8
-rw-r--r--lib/sys/sys+openbsd-x64.myr9
-rw-r--r--lib/sys/sys+osx-x64.myr8
5 files changed, 26 insertions, 15 deletions
diff --git a/lib/sys/sys+freebsd-x64.myr b/lib/sys/sys+freebsd-x64.myr
index 368359c..e7349a5 100644
--- a/lib/sys/sys+freebsd-x64.myr
+++ b/lib/sys/sys+freebsd-x64.myr
@@ -249,7 +249,6 @@ 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 */
@@ -269,6 +268,9 @@ pkg sys =
const Sonooffload : sockopt = 0x4000 /* socket cannot be offloaded */
const Sonoddp : sockopt = 0x8000 /* disable direct data placement */
+ /* socket option levels */
+ const Solsocket : sockproto = 0xffff
+
/* network protocols */
const Ipproto_ip : sockproto = 0
const Ipproto_icmp : sockproto = 1
@@ -866,8 +868,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)
diff --git a/lib/sys/sys+linux-x64.myr b/lib/sys/sys+linux-x64.myr
index 1d79151..4594a04 100644
--- a/lib/sys/sys+linux-x64.myr
+++ b/lib/sys/sys+linux-x64.myr
@@ -237,7 +237,6 @@ pkg sys =
const Sockseqpacket : socktype = 5 /* sequenced, reliable packets */
const Sockdccp : socktype = 6 /* data congestion control protocol */
const Sockpack : socktype = 10 /* linux specific packet */
- const Solsock : socktype = 1
/* socket options */
const Sodebug : sockopt = 1
@@ -264,6 +263,9 @@ pkg sys =
const Sorcvtimeo : sockopt = 20
const Sosndtimeo : sockopt = 21
+ /* socket option levels */
+ const Solsocket : sockproto = 1
+
/* network protocols */
const Ipproto_ip : sockproto = 0
const Ipproto_icmp : sockproto = 1
@@ -771,8 +773,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)
diff --git a/lib/sys/sys+netbsd-x64.myr b/lib/sys/sys+netbsd-x64.myr
index 8c0a7c1..94073e1 100644
--- a/lib/sys/sys+netbsd-x64.myr
+++ b/lib/sys/sys+netbsd-x64.myr
@@ -241,7 +241,6 @@ 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 */
@@ -261,6 +260,9 @@ pkg sys =
const Sonooffload : sockopt = 0x4000 /* socket cannot be offloaded */
const Sonoddp : sockopt = 0x8000 /* disable direct data placement */
+ /* socket option levels */
+ const Solsocket : sockproto = 0xffff
+
/* network protocols */
const Ipproto_ip : sockproto = 0
const Ipproto_icmp : sockproto = 1
@@ -885,8 +887,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)
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)
diff --git a/lib/sys/sys+osx-x64.myr b/lib/sys/sys+osx-x64.myr
index 4c98708..2c42094 100644
--- a/lib/sys/sys+osx-x64.myr
+++ b/lib/sys/sys+osx-x64.myr
@@ -283,7 +283,6 @@ 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 */
@@ -304,6 +303,9 @@ pkg sys =
const Sowantmore : sockopt = 0x4000 /* APPLE: Give hint when more data ready */
const Sowantoobflag : sockopt = 0x8000 /* APPLE: Want OOB in MSG_FLAG on receive */
+ /* socket option levels */
+ const Solsocket : sockproto = 0xffff
+
/* network protocols */
const Ipproto_ip : sockproto = 0
const Ipproto_icmp : sockproto = 1
@@ -797,8 +799,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)