shithub: mc

Download patch

ref: f9e53bfe1fc4d0177764550872b4fd6bee679205
parent: d975b42d6abcc4cbbfca1d62f1ef1e0d13564071
author: Ori Bernstein <[email protected]>
date: Wed Jun 11 19:30:30 EDT 2014

Actually use the linux-platform ifreq struct.

    I don't know if it's the same layout on OSX...

--- /dev/null
+++ b/libstd/ifreq-linux.myr
@@ -1,0 +1,65 @@
+pkg std
+	const Ifnamesize = 16
+
+	type ifreq_addr = struct
+		name	: byte[Ifnamesz]
+		addr	: sockaddr
+	;;
+
+	type ifreq_dstaddr = struct
+		name	: byte[Ifnamesz]
+		dstaddr	: sockaddr
+	;;
+
+	type ifreq_broadaddr = struct
+		name	: byte[Ifnamesz]
+		broadaddr	: sockaddr
+	;;
+
+	type ifreq_netmask = struct
+		name	: byte[Ifnamesz]
+		netmask	: sockaddr
+	;;
+
+
+	type ifreq_hwaddr = struct
+		name	: byte[Ifnamesz]
+		hwaddr	: sockaddr
+	;;
+
+	type ifreq_flags = struct
+		name	: byte[Ifnamesz]
+		flags	: int16
+	;;
+
+	type ifreq_ifindex = struct
+		name	: byte[Ifnamesz]
+		index	: int32
+	;;
+
+	type ifreq_metric = struct
+		name	: byte[Ifnamesz]
+		metric	: int32
+	;;
+
+
+	type ifreq_mtu = struct
+		name	: byte[Ifnamesz]
+		mtu	: int32
+	;;
+
+	type ifreq_slave = struct
+		name	: byte[Ifnamesz]
+		slave	: byte[Ifnamesz]
+	;;
+
+	type ifreq_newname = struct
+		name	: byte[Ifnamesz]
+		newname	: byte[Ifnamesz]
+	;;
+
+	type ifreq_data = struct
+		name	: byte[Ifnamesz]
+		data	: void#
+	;;
+;;
--- a/libstd/ifreq.myr
+++ /dev/null
@@ -1,67 +1,0 @@
-use "sys.use"
-
-pkg std =
-	const Ifnamesz = 16
-
-	type ifreq_addr = struct
-		name	: byte[Ifnamesz]
-		addr	: sockaddr
-	;;
-
-	type ifreq_dstaddr = struct
-		name	: byte[Ifnamesz]
-		dstaddr	: sockaddr
-	;;
-
-	type ifreq_broadaddr = struct
-		name	: byte[Ifnamesz]
-		broadaddr	: sockaddr
-	;;
-
-	type ifreq_netmask = struct
-		name	: byte[Ifnamesz]
-		netmask	: sockaddr
-	;;
-
-
-	type ifreq_hwaddr = struct
-		name	: byte[Ifnamesz]
-		hwaddr	: sockaddr
-	;;
-
-	type ifreq_flags = struct
-		name	: byte[Ifnamesz]
-		flags	: int16
-	;;
-
-	type ifreq_ifindex = struct
-		name	: byte[Ifnamesz]
-		index	: int32
-	;;
-
-	type ifreq_metric = struct
-		name	: byte[Ifnamesz]
-		metric	: int32
-	;;
-
-
-	type ifreq_mtu = struct
-		name	: byte[Ifnamesz]
-		mtu	: int32
-	;;
-
-	type ifreq_slave = struct
-		name	: byte[Ifnamesz]
-		slave	: byte[Ifnamesz]
-	;;
-
-	type ifreq_newname = struct
-		name	: byte[Ifnamesz]
-		newname	: byte[Ifnamesz]
-	;;
-
-	type ifreq_data = struct
-		name	: byte[Ifnamesz]
-		data	: void#
-	;;
-;;