diff --git a/src/pkg/syscall/mkerrors.sh b/src/pkg/syscall/mkerrors.sh
index 92bc9c545388ec7f683b8bbf2ff0045de2f3452d..593700efa8070a9fd2300b7dcb1170b0aa7e897e 100755
--- a/src/pkg/syscall/mkerrors.sh
+++ b/src/pkg/syscall/mkerrors.sh
@@ -7,6 +7,10 @@
 # values (ENAMETOOLONG etc.), by asking the preprocessor
 # about the definitions.
 
+unset LANG
+export LC_ALL=C
+export LC_CTYPE=C
+
 case "$GOARCH" in
 arm)
 	GCC=arm-gcc
@@ -72,7 +76,7 @@ includes='
 
 		$2 ~ /^E[A-Z0-9_]+$/ ||
 		$2 ~ /^SIG[^_]/ ||
-		$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|TCP|EVFILT|EV)_/ ||
+		$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|TCP|EVFILT|EV|SHUT|PROT|MAP)_/ ||
 		$2 == "SOMAXCONN" ||
 		$2 == "NAME_MAX" ||
 		$2 ~ /^(O|F|FD|NAME|S|PTRACE)_/ ||
@@ -89,7 +93,8 @@ includes='
 # Pull out just the error names for later.
 errors=$(
 	echo '#include <errno.h>' | $GCC -x c - -E -dM |
-	awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }'
+	awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' |
+	sort
 )
 
 echo '// mkerrors.sh' "$@"
diff --git a/src/pkg/syscall/syscall_darwin.go b/src/pkg/syscall/syscall_darwin.go
index b2e6de7b6c76d76f949f3eb0532d42ee63812223..bb28bc1e9731966758e8ff84e0c19ef2a2816add 100644
--- a/src/pkg/syscall/syscall_darwin.go
+++ b/src/pkg/syscall/syscall_darwin.go
@@ -158,6 +158,7 @@ func Sleep(ns int64) (errno int) {
 //sys	setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int)
 //sys	getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int)
 //sys	getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int)
+//sys	Shutdown(s int, how int) (errno int)
 
 // For testing: clients can set this flag to force
 // creation of IPv6 sockets to return EAFNOSUPPORT.
diff --git a/src/pkg/syscall/zerrors_darwin_386.go b/src/pkg/syscall/zerrors_darwin_386.go
index 61afee26191f23026db1c536a21a28f6b729bb57..84a07e3c2534240f0578ce828ccbfb241b80ee63 100644
--- a/src/pkg/syscall/zerrors_darwin_386.go
+++ b/src/pkg/syscall/zerrors_darwin_386.go
@@ -20,6 +20,7 @@ const (
 	AF_E164				= 0x1c;
 	AF_ECMA				= 0x8;
 	AF_HYLINK			= 0xf;
+	AF_IEEE80211			= 0x25;
 	AF_IMPLINK			= 0x3;
 	AF_INET				= 0x2;
 	AF_INET6			= 0x1e;
@@ -29,7 +30,7 @@ const (
 	AF_LAT				= 0xe;
 	AF_LINK				= 0x12;
 	AF_LOCAL			= 0x1;
-	AF_MAX				= 0x25;
+	AF_MAX				= 0x26;
 	AF_NATM				= 0x1f;
 	AF_NDRV				= 0x1b;
 	AF_NETBIOS			= 0x21;
@@ -152,16 +153,19 @@ const (
 	EVFILT_MACHPORT			= -0x8;
 	EVFILT_PROC			= -0x5;
 	EVFILT_READ			= -0x1;
+	EVFILT_SESSION			= -0xb;
 	EVFILT_SIGNAL			= -0x6;
-	EVFILT_SYSCOUNT			= 0x9;
-	EVFILT_THREADMARKER		= 0x9;
+	EVFILT_SYSCOUNT			= 0xb;
+	EVFILT_THREADMARKER		= 0xb;
 	EVFILT_TIMER			= -0x7;
+	EVFILT_USER			= -0xa;
 	EVFILT_VNODE			= -0x4;
 	EVFILT_WRITE			= -0x2;
 	EV_ADD				= 0x1;
 	EV_CLEAR			= 0x20;
 	EV_DELETE			= 0x2;
 	EV_DISABLE			= 0x8;
+	EV_DISPATCH			= 0x80;
 	EV_ENABLE			= 0x4;
 	EV_EOF				= 0x8000;
 	EV_ERROR			= 0x4000;
@@ -172,10 +176,12 @@ const (
 	EV_POLL				= 0x1000;
 	EV_RECEIPT			= 0x40;
 	EV_SYSFLAGS			= 0xf000;
+	EV_TRIGGER			= 0x100;
 	EWOULDBLOCK			= 0x23;
 	EXDEV				= 0x12;
 	FD_CLOEXEC			= 0x1;
 	FD_SETSIZE			= 0x400;
+	F_ADDFILESIGS			= 0x3d;
 	F_ADDSIGS			= 0x3b;
 	F_ALLOCATEALL			= 0x4;
 	F_ALLOCATECONTIG		= 0x2;
@@ -318,6 +324,7 @@ const (
 	IPPROTO_XNET			= 0xf;
 	IPPROTO_XTP			= 0x24;
 	IP_ADD_MEMBERSHIP		= 0xc;
+	IP_BOUND_IF			= 0x19;
 	IP_DEFAULT_MULTICAST_LOOP	= 0x1;
 	IP_DEFAULT_MULTICAST_TTL	= 0x1;
 	IP_DROP_MEMBERSHIP		= 0xd;
@@ -371,6 +378,7 @@ const (
 	O_ASYNC				= 0x40;
 	O_CREAT				= 0x200;
 	O_DIRECTORY			= 0x100000;
+	O_DSYNC				= 0x400000;
 	O_EVTONLY			= 0x8000;
 	O_EXCL				= 0x800;
 	O_EXLOCK			= 0x20;
@@ -387,6 +395,9 @@ const (
 	O_SYNC				= 0x80;
 	O_TRUNC				= 0x400;
 	O_WRONLY			= 0x1;
+	SHUT_RD				= 0;
+	SHUT_RDWR			= 0x2;
+	SHUT_WR				= 0x1;
 	SIGABRT				= 0x6;
 	SIGALRM				= 0xe;
 	SIGBUS				= 0xa;
@@ -441,10 +452,12 @@ const (
 	SO_NOADDRERR			= 0x1023;
 	SO_NOSIGPIPE			= 0x1022;
 	SO_NOTIFYCONFLICT		= 0x1026;
+	SO_NP_EXTENSIONS		= 0x1083;
 	SO_NREAD			= 0x1020;
 	SO_NWRITE			= 0x1024;
 	SO_OOBINLINE			= 0x100;
 	SO_PEERLABEL			= 0x1011;
+	SO_RANDOMPORT			= 0x1082;
 	SO_RCVBUF			= 0x1002;
 	SO_RCVLOWAT			= 0x1004;
 	SO_RCVTIMEO			= 0x1006;
@@ -460,6 +473,7 @@ const (
 	SO_SNDTIMEO			= 0x1005;
 	SO_TIMESTAMP			= 0x400;
 	SO_TYPE				= 0x1008;
+	SO_UPCALLCLOSEWAIT		= 0x1027;
 	SO_USELOOPBACK			= 0x40;
 	SO_WANTMORE			= 0x4000;
 	SO_WANTOOBFLAG			= 0x8000;
@@ -473,7 +487,6 @@ const (
 	S_IFREG				= 0x8000;
 	S_IFSOCK			= 0xc000;
 	S_IFWHT				= 0xe000;
-	S_IFXATTR			= 0x10000;
 	S_IREAD				= 0x100;
 	S_IRGRP				= 0x20;
 	S_IROTH				= 0x4;
@@ -492,6 +505,7 @@ const (
 	S_IXGRP				= 0x8;
 	S_IXOTH				= 0x1;
 	S_IXUSR				= 0x40;
+	TCP_CONNECTIONTIMEOUT		= 0x20;
 	TCP_KEEPALIVE			= 0x10;
 	TCP_MAXBURST			= 0x4;
 	TCP_MAXHLEN			= 0x3c;
@@ -511,7 +525,7 @@ const (
 	WEXITED				= 0x4;
 	WNOHANG				= 0x1;
 	WNOWAIT				= 0x20;
-	WORDSIZE			= 0x20;
+	WORDSIZE			= 0x40;
 	WSTOPPED			= 0x7f;
 	WUNTRACED			= 0x2;
 )
@@ -521,107 +535,107 @@ const (
 
 // Error table
 var errors = [...]string{
-	95: "EMULTIHOP (Reserved)",
-	47: "address family not supported by protocol family",
+	7: "argument list too long",
 	13: "permission denied",
-	39: "destination address required",
-	92: "illegal byte sequence",
-	29: "illegal seek",
-	31: "too many links",
-	74: "RPC prog. not avail",
-	25: "inappropriate ioctl for device",
-	9: "bad file descriptor",
-	34: "result too large",
-	89: "operation canceled",
-	26: "text file busy",
-	12: "cannot allocate memory",
-	36: "operation now in progress",
-	66: "directory not empty",
-	15: "block device required",
-	41: "protocol wrong type for socket",
-	91: "no message of desired type",
-	73: "RPC version wrong",
-	20: "not a directory",
+	48: "address already in use",
+	49: "can't assign requested address",
+	47: "address family not supported by protocol family",
+	35: "resource temporarily unavailable",
 	37: "operation already in progress",
-	60: "operation timed out",
-	81: "need authenticator",
-	96: "no message available on STREAM",
-	4: "interrupted system call",
-	97: "ENOLINK (Reserved)",
-	1: "operation not permitted",
-	50: "network is down",
-	70: "stale NFS file handle",
-	38: "socket operation on non-socket",
-	98: "no STREAM resources",
 	80: "authentication error",
-	10: "no child processes",
-	32: "broken pipe",
-	93: "attribute not found",
+	86: "bad CPU type in executable",
+	85: "bad executable (or shared library)",
+	9: "bad file descriptor",
+	88: "malformed Mach-o file",
 	94: "bad message",
-	71: "too many levels of remote in path",
-	59: "too many references: can't splice",
-	46: "protocol family not supported",
-	76: "bad procedure for program",
-	48: "address already in use",
-	52: "network dropped connection on reset",
-	21: "is a directory",
-	90: "identifier removed",
-	83: "device error",
-	22: "invalid argument",
-	58: "can't send after socket shutdown",
-	82: "device power is off",
-	84: "value too large to be stored in data type",
+	72: "RPC struct is bad",
 	16: "resource busy",
-	67: "too many processes",
-	100: "protocol error",
-	19: "operation not supported by device",
-	30: "read-only file system",
-	7: "argument list too long",
-	11: "resource deadlock avoided",
+	89: "operation canceled",
+	10: "no child processes",
+	53: "software caused connection abort",
+	61: "connection refused",
 	54: "connection reset by peer",
-	88: "malformed Mach-o file",
-	6: "device not configured",
-	72: "RPC struct is bad",
-	63: "file name too long",
-	103: "policy not found",
-	44: "socket type not supported",
-	49: "can't assign requested address",
-	101: "STREAM ioctl timeout",
-	43: "protocol not supported",
-	5: "input/output error",
-	51: "network is unreachable",
-	18: "cross-device link",
-	69: "disc quota exceeded",
-	28: "no space left on device",
-	8: "exec format error",
-	40: "message too long",
-	79: "inappropriate file type or format",
+	11: "resource deadlock avoided",
+	39: "destination address required",
+	83: "device error",
 	33: "numerical argument out of domain",
-	99: "not a STREAM",
+	69: "disc quota exceeded",
+	17: "file exists",
+	14: "bad address",
 	27: "file too large",
-	3: "no such process",
+	79: "inappropriate file type or format",
 	64: "host is down",
-	77: "no locks available",
+	65: "no route to host",
+	90: "identifier removed",
+	92: "illegal byte sequence",
+	36: "operation now in progress",
+	4: "interrupted system call",
+	22: "invalid argument",
+	5: "input/output error",
+	56: "socket is already connected",
+	21: "is a directory",
+	103: "policy not found",
+	62: "too many levels of symbolic links",
+	24: "too many open files",
+	31: "too many links",
+	40: "message too long",
+	95: "EMULTIHOP (Reserved)",
+	63: "file name too long",
+	81: "need authenticator",
+	50: "network is down",
+	52: "network dropped connection on reset",
+	51: "network is unreachable",
 	23: "too many open files in system",
+	93: "attribute not found",
+	55: "no buffer space available",
+	96: "no message available on STREAM",
+	19: "operation not supported by device",
+	2: "no such file or directory",
+	8: "exec format error",
+	77: "no locks available",
+	97: "ENOLINK (Reserved)",
+	12: "cannot allocate memory",
+	91: "no message of desired type",
+	42: "protocol not available",
+	28: "no space left on device",
+	98: "no STREAM resources",
+	99: "not a STREAM",
 	78: "function not implemented",
-	86: "bad CPU type in executable",
+	15: "block device required",
 	57: "socket is not connected",
+	20: "not a directory",
+	66: "directory not empty",
+	38: "socket operation on non-socket",
 	45: "operation not supported",
-	53: "software caused connection abort",
-	56: "socket is already connected",
+	25: "inappropriate ioctl for device",
+	6: "device not configured",
+	102: "operation not supported on socket",
+	84: "value too large to be stored in data type",
+	1: "operation not permitted",
+	46: "protocol family not supported",
+	32: "broken pipe",
+	67: "too many processes",
+	76: "bad procedure for program",
+	75: "program version wrong",
+	74: "RPC prog. not avail",
+	100: "protocol error",
+	43: "protocol not supported",
+	41: "protocol wrong type for socket",
+	82: "device power is off",
+	34: "result too large",
+	71: "too many levels of remote in path",
+	30: "read-only file system",
+	73: "RPC version wrong",
 	87: "shared library version mismatch",
+	58: "can't send after socket shutdown",
+	44: "socket type not supported",
+	29: "illegal seek",
+	3: "no such process",
+	70: "stale NFS file handle",
+	101: "STREAM ioctl timeout",
+	60: "operation timed out",
+	59: "too many references: can't splice",
+	26: "text file busy",
 	68: "too many users",
-	42: "protocol not available",
-	24: "too many open files",
-	62: "too many levels of symbolic links",
-	55: "no buffer space available",
-	14: "bad address",
-	35: "resource temporarily unavailable",
-	85: "bad executable (or shared library)",
-	61: "connection refused",
-	17: "file exists",
-	75: "program version wrong",
-	2: "no such file or directory",
-	65: "no route to host",
-	102: "operation not supported on socket",
+	18: "cross-device link",
 }
diff --git a/src/pkg/syscall/zerrors_darwin_amd64.go b/src/pkg/syscall/zerrors_darwin_amd64.go
index 4643073c3957054f9e6ee40b40071058f57f35f1..84a07e3c2534240f0578ce828ccbfb241b80ee63 100644
--- a/src/pkg/syscall/zerrors_darwin_amd64.go
+++ b/src/pkg/syscall/zerrors_darwin_amd64.go
@@ -20,6 +20,7 @@ const (
 	AF_E164				= 0x1c;
 	AF_ECMA				= 0x8;
 	AF_HYLINK			= 0xf;
+	AF_IEEE80211			= 0x25;
 	AF_IMPLINK			= 0x3;
 	AF_INET				= 0x2;
 	AF_INET6			= 0x1e;
@@ -29,7 +30,7 @@ const (
 	AF_LAT				= 0xe;
 	AF_LINK				= 0x12;
 	AF_LOCAL			= 0x1;
-	AF_MAX				= 0x25;
+	AF_MAX				= 0x26;
 	AF_NATM				= 0x1f;
 	AF_NDRV				= 0x1b;
 	AF_NETBIOS			= 0x21;
@@ -152,16 +153,19 @@ const (
 	EVFILT_MACHPORT			= -0x8;
 	EVFILT_PROC			= -0x5;
 	EVFILT_READ			= -0x1;
+	EVFILT_SESSION			= -0xb;
 	EVFILT_SIGNAL			= -0x6;
-	EVFILT_SYSCOUNT			= 0x9;
-	EVFILT_THREADMARKER		= 0x9;
+	EVFILT_SYSCOUNT			= 0xb;
+	EVFILT_THREADMARKER		= 0xb;
 	EVFILT_TIMER			= -0x7;
+	EVFILT_USER			= -0xa;
 	EVFILT_VNODE			= -0x4;
 	EVFILT_WRITE			= -0x2;
 	EV_ADD				= 0x1;
 	EV_CLEAR			= 0x20;
 	EV_DELETE			= 0x2;
 	EV_DISABLE			= 0x8;
+	EV_DISPATCH			= 0x80;
 	EV_ENABLE			= 0x4;
 	EV_EOF				= 0x8000;
 	EV_ERROR			= 0x4000;
@@ -172,10 +176,12 @@ const (
 	EV_POLL				= 0x1000;
 	EV_RECEIPT			= 0x40;
 	EV_SYSFLAGS			= 0xf000;
+	EV_TRIGGER			= 0x100;
 	EWOULDBLOCK			= 0x23;
 	EXDEV				= 0x12;
 	FD_CLOEXEC			= 0x1;
 	FD_SETSIZE			= 0x400;
+	F_ADDFILESIGS			= 0x3d;
 	F_ADDSIGS			= 0x3b;
 	F_ALLOCATEALL			= 0x4;
 	F_ALLOCATECONTIG		= 0x2;
@@ -318,6 +324,7 @@ const (
 	IPPROTO_XNET			= 0xf;
 	IPPROTO_XTP			= 0x24;
 	IP_ADD_MEMBERSHIP		= 0xc;
+	IP_BOUND_IF			= 0x19;
 	IP_DEFAULT_MULTICAST_LOOP	= 0x1;
 	IP_DEFAULT_MULTICAST_TTL	= 0x1;
 	IP_DROP_MEMBERSHIP		= 0xd;
@@ -371,6 +378,7 @@ const (
 	O_ASYNC				= 0x40;
 	O_CREAT				= 0x200;
 	O_DIRECTORY			= 0x100000;
+	O_DSYNC				= 0x400000;
 	O_EVTONLY			= 0x8000;
 	O_EXCL				= 0x800;
 	O_EXLOCK			= 0x20;
@@ -387,6 +395,9 @@ const (
 	O_SYNC				= 0x80;
 	O_TRUNC				= 0x400;
 	O_WRONLY			= 0x1;
+	SHUT_RD				= 0;
+	SHUT_RDWR			= 0x2;
+	SHUT_WR				= 0x1;
 	SIGABRT				= 0x6;
 	SIGALRM				= 0xe;
 	SIGBUS				= 0xa;
@@ -441,10 +452,12 @@ const (
 	SO_NOADDRERR			= 0x1023;
 	SO_NOSIGPIPE			= 0x1022;
 	SO_NOTIFYCONFLICT		= 0x1026;
+	SO_NP_EXTENSIONS		= 0x1083;
 	SO_NREAD			= 0x1020;
 	SO_NWRITE			= 0x1024;
 	SO_OOBINLINE			= 0x100;
 	SO_PEERLABEL			= 0x1011;
+	SO_RANDOMPORT			= 0x1082;
 	SO_RCVBUF			= 0x1002;
 	SO_RCVLOWAT			= 0x1004;
 	SO_RCVTIMEO			= 0x1006;
@@ -460,6 +473,7 @@ const (
 	SO_SNDTIMEO			= 0x1005;
 	SO_TIMESTAMP			= 0x400;
 	SO_TYPE				= 0x1008;
+	SO_UPCALLCLOSEWAIT		= 0x1027;
 	SO_USELOOPBACK			= 0x40;
 	SO_WANTMORE			= 0x4000;
 	SO_WANTOOBFLAG			= 0x8000;
@@ -473,7 +487,6 @@ const (
 	S_IFREG				= 0x8000;
 	S_IFSOCK			= 0xc000;
 	S_IFWHT				= 0xe000;
-	S_IFXATTR			= 0x10000;
 	S_IREAD				= 0x100;
 	S_IRGRP				= 0x20;
 	S_IROTH				= 0x4;
@@ -492,6 +505,7 @@ const (
 	S_IXGRP				= 0x8;
 	S_IXOTH				= 0x1;
 	S_IXUSR				= 0x40;
+	TCP_CONNECTIONTIMEOUT		= 0x20;
 	TCP_KEEPALIVE			= 0x10;
 	TCP_MAXBURST			= 0x4;
 	TCP_MAXHLEN			= 0x3c;
@@ -511,6 +525,7 @@ const (
 	WEXITED				= 0x4;
 	WNOHANG				= 0x1;
 	WNOWAIT				= 0x20;
+	WORDSIZE			= 0x40;
 	WSTOPPED			= 0x7f;
 	WUNTRACED			= 0x2;
 )
@@ -520,107 +535,107 @@ const (
 
 // Error table
 var errors = [...]string{
-	95: "EMULTIHOP (Reserved)",
-	47: "address family not supported by protocol family",
+	7: "argument list too long",
 	13: "permission denied",
-	39: "destination address required",
-	92: "illegal byte sequence",
-	29: "illegal seek",
-	31: "too many links",
-	74: "RPC prog. not avail",
-	25: "inappropriate ioctl for device",
-	9: "bad file descriptor",
-	34: "result too large",
-	89: "operation canceled",
-	26: "text file busy",
-	12: "cannot allocate memory",
-	36: "operation now in progress",
-	66: "directory not empty",
-	15: "block device required",
-	41: "protocol wrong type for socket",
-	91: "no message of desired type",
-	73: "RPC version wrong",
-	20: "not a directory",
+	48: "address already in use",
+	49: "can't assign requested address",
+	47: "address family not supported by protocol family",
+	35: "resource temporarily unavailable",
 	37: "operation already in progress",
-	60: "operation timed out",
-	81: "need authenticator",
-	96: "no message available on STREAM",
-	4: "interrupted system call",
-	97: "ENOLINK (Reserved)",
-	1: "operation not permitted",
-	50: "network is down",
-	70: "stale NFS file handle",
-	38: "socket operation on non-socket",
-	98: "no STREAM resources",
 	80: "authentication error",
-	10: "no child processes",
-	32: "broken pipe",
-	93: "attribute not found",
+	86: "bad CPU type in executable",
+	85: "bad executable (or shared library)",
+	9: "bad file descriptor",
+	88: "malformed Mach-o file",
 	94: "bad message",
-	71: "too many levels of remote in path",
-	59: "too many references: can't splice",
-	46: "protocol family not supported",
-	76: "bad procedure for program",
-	48: "address already in use",
-	52: "network dropped connection on reset",
-	21: "is a directory",
-	90: "identifier removed",
-	83: "device error",
-	22: "invalid argument",
-	58: "can't send after socket shutdown",
-	82: "device power is off",
-	84: "value too large to be stored in data type",
+	72: "RPC struct is bad",
 	16: "resource busy",
-	67: "too many processes",
-	100: "protocol error",
-	19: "operation not supported by device",
-	30: "read-only file system",
-	7: "argument list too long",
-	11: "resource deadlock avoided",
+	89: "operation canceled",
+	10: "no child processes",
+	53: "software caused connection abort",
+	61: "connection refused",
 	54: "connection reset by peer",
-	88: "malformed Mach-o file",
-	6: "device not configured",
-	72: "RPC struct is bad",
-	63: "file name too long",
-	103: "policy not found",
-	44: "socket type not supported",
-	49: "can't assign requested address",
-	101: "STREAM ioctl timeout",
-	43: "protocol not supported",
-	5: "input/output error",
-	51: "network is unreachable",
-	18: "cross-device link",
-	69: "disc quota exceeded",
-	28: "no space left on device",
-	8: "exec format error",
-	40: "message too long",
-	79: "inappropriate file type or format",
+	11: "resource deadlock avoided",
+	39: "destination address required",
+	83: "device error",
 	33: "numerical argument out of domain",
-	99: "not a STREAM",
+	69: "disc quota exceeded",
+	17: "file exists",
+	14: "bad address",
 	27: "file too large",
-	3: "no such process",
+	79: "inappropriate file type or format",
 	64: "host is down",
-	77: "no locks available",
+	65: "no route to host",
+	90: "identifier removed",
+	92: "illegal byte sequence",
+	36: "operation now in progress",
+	4: "interrupted system call",
+	22: "invalid argument",
+	5: "input/output error",
+	56: "socket is already connected",
+	21: "is a directory",
+	103: "policy not found",
+	62: "too many levels of symbolic links",
+	24: "too many open files",
+	31: "too many links",
+	40: "message too long",
+	95: "EMULTIHOP (Reserved)",
+	63: "file name too long",
+	81: "need authenticator",
+	50: "network is down",
+	52: "network dropped connection on reset",
+	51: "network is unreachable",
 	23: "too many open files in system",
+	93: "attribute not found",
+	55: "no buffer space available",
+	96: "no message available on STREAM",
+	19: "operation not supported by device",
+	2: "no such file or directory",
+	8: "exec format error",
+	77: "no locks available",
+	97: "ENOLINK (Reserved)",
+	12: "cannot allocate memory",
+	91: "no message of desired type",
+	42: "protocol not available",
+	28: "no space left on device",
+	98: "no STREAM resources",
+	99: "not a STREAM",
 	78: "function not implemented",
-	86: "bad CPU type in executable",
+	15: "block device required",
 	57: "socket is not connected",
+	20: "not a directory",
+	66: "directory not empty",
+	38: "socket operation on non-socket",
 	45: "operation not supported",
-	53: "software caused connection abort",
-	56: "socket is already connected",
+	25: "inappropriate ioctl for device",
+	6: "device not configured",
+	102: "operation not supported on socket",
+	84: "value too large to be stored in data type",
+	1: "operation not permitted",
+	46: "protocol family not supported",
+	32: "broken pipe",
+	67: "too many processes",
+	76: "bad procedure for program",
+	75: "program version wrong",
+	74: "RPC prog. not avail",
+	100: "protocol error",
+	43: "protocol not supported",
+	41: "protocol wrong type for socket",
+	82: "device power is off",
+	34: "result too large",
+	71: "too many levels of remote in path",
+	30: "read-only file system",
+	73: "RPC version wrong",
 	87: "shared library version mismatch",
+	58: "can't send after socket shutdown",
+	44: "socket type not supported",
+	29: "illegal seek",
+	3: "no such process",
+	70: "stale NFS file handle",
+	101: "STREAM ioctl timeout",
+	60: "operation timed out",
+	59: "too many references: can't splice",
+	26: "text file busy",
 	68: "too many users",
-	42: "protocol not available",
-	24: "too many open files",
-	62: "too many levels of symbolic links",
-	55: "no buffer space available",
-	14: "bad address",
-	35: "resource temporarily unavailable",
-	85: "bad executable (or shared library)",
-	61: "connection refused",
-	17: "file exists",
-	75: "program version wrong",
-	2: "no such file or directory",
-	65: "no route to host",
-	102: "operation not supported on socket",
+	18: "cross-device link",
 }
diff --git a/src/pkg/syscall/zerrors_linux_386.go b/src/pkg/syscall/zerrors_linux_386.go
index abc449319322f648574c1a9a07d23d96245e1619..bca74b340202e42082723665156792be1e4d993e 100644
--- a/src/pkg/syscall/zerrors_linux_386.go
+++ b/src/pkg/syscall/zerrors_linux_386.go
@@ -16,27 +16,34 @@ const (
 	AF_AX25					= 0x3;
 	AF_BLUETOOTH				= 0x1f;
 	AF_BRIDGE				= 0x7;
+	AF_CAN					= 0x1d;
 	AF_DECnet				= 0xc;
 	AF_ECONET				= 0x13;
 	AF_FILE					= 0x1;
+	AF_IEEE802154				= 0x24;
 	AF_INET					= 0x2;
 	AF_INET6				= 0xa;
 	AF_IPX					= 0x4;
 	AF_IRDA					= 0x17;
+	AF_ISDN					= 0x22;
 	AF_IUCV					= 0x20;
 	AF_KEY					= 0xf;
+	AF_LLC					= 0x1a;
 	AF_LOCAL				= 0x1;
-	AF_MAX					= 0x22;
+	AF_MAX					= 0x25;
 	AF_NETBEUI				= 0xd;
 	AF_NETLINK				= 0x10;
 	AF_NETROM				= 0x6;
 	AF_PACKET				= 0x11;
+	AF_PHONET				= 0x23;
 	AF_PPPOX				= 0x18;
+	AF_RDS					= 0x15;
 	AF_ROSE					= 0xb;
 	AF_ROUTE				= 0x10;
 	AF_RXRPC				= 0x21;
 	AF_SECURITY				= 0xe;
 	AF_SNA					= 0x16;
+	AF_TIPC					= 0x1e;
 	AF_UNIX					= 0x1;
 	AF_UNSPEC				= 0;
 	AF_WANPIPE				= 0x19;
@@ -160,9 +167,11 @@ const (
 	EPOLLRDNORM				= 0x40;
 	EPOLLWRBAND				= 0x200;
 	EPOLLWRNORM				= 0x100;
+	EPOLL_CLOEXEC				= 0x80000;
 	EPOLL_CTL_ADD				= 0x1;
 	EPOLL_CTL_DEL				= 0x2;
 	EPOLL_CTL_MOD				= 0x3;
+	EPOLL_NONBLOCK				= 0x800;
 	EPROTO					= 0x47;
 	EPROTONOSUPPORT				= 0x5d;
 	EPROTOTYPE				= 0x5b;
@@ -171,6 +180,7 @@ const (
 	EREMOTE					= 0x42;
 	EREMOTEIO				= 0x79;
 	ERESTART				= 0x55;
+	ERFKILL					= 0x84;
 	EROFS					= 0x1e;
 	ESHUTDOWN				= 0x6c;
 	ESOCKTNOSUPPORT				= 0x5e;
@@ -189,7 +199,6 @@ const (
 	EWOULDBLOCK				= 0xb;
 	EXDEV					= 0x12;
 	EXFULL					= 0x36;
-	EXPR_NEST_MAX				= 0x20;
 	FD_CLOEXEC				= 0x1;
 	FD_SETSIZE				= 0x400;
 	F_DUPFD					= 0;
@@ -223,6 +232,7 @@ const (
 	F_WRLCK					= 0x1;
 	IPPROTO_AH				= 0x33;
 	IPPROTO_COMP				= 0x6c;
+	IPPROTO_DCCP				= 0x21;
 	IPPROTO_DSTOPTS				= 0x3c;
 	IPPROTO_EGP				= 0x8;
 	IPPROTO_ENCAP				= 0x62;
@@ -248,6 +258,7 @@ const (
 	IPPROTO_TCP				= 0x6;
 	IPPROTO_TP				= 0x1d;
 	IPPROTO_UDP				= 0x11;
+	IPPROTO_UDPLITE				= 0x88;
 	IP_ADD_MEMBERSHIP			= 0x23;
 	IP_ADD_SOURCE_MEMBERSHIP		= 0x27;
 	IP_BLOCK_SOURCE				= 0x26;
@@ -268,6 +279,7 @@ const (
 	IP_PMTUDISC				= 0xa;
 	IP_PMTUDISC_DO				= 0x2;
 	IP_PMTUDISC_DONT			= 0;
+	IP_PMTUDISC_PROBE			= 0x3;
 	IP_PMTUDISC_WANT			= 0x1;
 	IP_RECVERR				= 0xb;
 	IP_RECVOPTS				= 0x6;
@@ -304,6 +316,16 @@ const (
 	O_WRONLY				= 0x1;
 	PTRACE_ARCH_PRCTL			= 0x1e;
 	PTRACE_ATTACH				= 0x10;
+	PTRACE_BTS_CLEAR			= 0x2c;
+	PTRACE_BTS_CONFIG			= 0x28;
+	PTRACE_BTS_DRAIN			= 0x2d;
+	PTRACE_BTS_GET				= 0x2b;
+	PTRACE_BTS_O_ALLOC			= 0x8;
+	PTRACE_BTS_O_SCHED			= 0x2;
+	PTRACE_BTS_O_SIGNAL			= 0x4;
+	PTRACE_BTS_O_TRACE			= 0x1;
+	PTRACE_BTS_SIZE				= 0x2a;
+	PTRACE_BTS_STATUS			= 0x29;
 	PTRACE_CONT				= 0x7;
 	PTRACE_DETACH				= 0x11;
 	PTRACE_EVENT_CLONE			= 0x3;
@@ -340,9 +362,15 @@ const (
 	PTRACE_SETREGS				= 0xd;
 	PTRACE_SETSIGINFO			= 0x4203;
 	PTRACE_SET_THREAD_AREA			= 0x1a;
+	PTRACE_SINGLEBLOCK			= 0x21;
 	PTRACE_SINGLESTEP			= 0x9;
 	PTRACE_SYSCALL				= 0x18;
+	PTRACE_SYSEMU				= 0x1f;
+	PTRACE_SYSEMU_SINGLESTEP		= 0x20;
 	PTRACE_TRACEME				= 0;
+	SHUT_RD					= 0;
+	SHUT_RDWR				= 0x2;
+	SHUT_WR					= 0x1;
 	SIGABRT					= 0x6;
 	SIGALRM					= 0xe;
 	SIGBUS					= 0x7;
@@ -378,7 +406,10 @@ const (
 	SIGWINCH				= 0x1c;
 	SIGXCPU					= 0x18;
 	SIGXFSZ					= 0x19;
+	SOCK_CLOEXEC				= 0x80000;
+	SOCK_DCCP				= 0x6;
 	SOCK_DGRAM				= 0x2;
+	SOCK_NONBLOCK				= 0x800;
 	SOCK_PACKET				= 0xa;
 	SOCK_RAW				= 0x3;
 	SOCK_RDM				= 0x4;
@@ -408,6 +439,7 @@ const (
 	SO_ERROR				= 0x4;
 	SO_KEEPALIVE				= 0x9;
 	SO_LINGER				= 0xd;
+	SO_MARK					= 0x24;
 	SO_NO_CHECK				= 0xb;
 	SO_OOBINLINE				= 0xa;
 	SO_PASSCRED				= 0x10;
@@ -429,6 +461,7 @@ const (
 	SO_SNDLOWAT				= 0x13;
 	SO_SNDTIMEO				= 0x15;
 	SO_TIMESTAMP				= 0x1d;
+	SO_TIMESTAMPING				= 0x25;
 	SO_TIMESTAMPNS				= 0x23;
 	SO_TYPE					= 0x3;
 	S_BLKSIZE				= 0x200;
@@ -493,133 +526,134 @@ const (
 
 // Error table
 var errors = [...]string{
-	72: "multihop attempted",
-	49: "protocol driver not attached",
-	97: "address family not supported by protocol",
-	78: "remote address changed",
+	7: "argument list too long",
 	13: "permission denied",
-	47: "level 3 reset",
-	89: "destination address required",
-	84: "invalid or incomplete multibyte or wide character",
-	29: "illegal seek",
-	31: "too many links",
-	130: "owner died",
-	25: "inappropriate ioctl for device",
+	98: "address already in use",
+	99: "cannot assign requested address",
+	68: "advertise error",
+	97: "address family not supported by protocol",
+	11: "resource temporarily unavailable",
+	114: "operation already in progress",
 	52: "invalid exchange",
 	9: "bad file descriptor",
+	77: "file descriptor in bad state",
+	74: "bad message",
 	53: "invalid request descriptor",
-	68: "advertise error",
-	34: "numerical result out of range",
+	56: "invalid request code",
+	57: "invalid slot",
+	59: "bad font file format",
+	16: "device or resource busy",
 	125: "operation canceled",
-	26: "text file busy",
-	12: "cannot allocate memory",
-	115: "operation now in progress",
-	15: "block device required",
-	91: "protocol wrong type for socket",
-	85: "interrupted system call should be restarted",
-	120: "is a named type file",
-	42: "no message of desired type",
-	114: "operation already in progress",
-	110: "connection timed out",
-	61: "no data available",
-	4: "interrupted system call",
-	67: "link has been severed",
-	1: "operation not permitted",
-	40: "too many levels of symbolic links",
-	100: "network is down",
-	116: "stale NFS file handle",
-	88: "socket operation on non-socket",
-	63: "out of streams resources",
 	10: "no child processes",
-	48: "link number out of range",
-	32: "broken pipe",
-	74: "bad message",
-	59: "bad font file format",
-	66: "object is remote",
-	109: "too many references: cannot splice",
-	96: "protocol family not supported",
-	64: "machine is not on the network",
-	54: "exchange full",
-	57: "invalid slot",
-	118: "not a XENIX named type file",
-	83: "cannot exec a shared library directly",
-	50: "no CSI structure available",
-	39: "directory not empty",
-	98: "address already in use",
-	102: "network dropped connection on reset",
-	21: "is a directory",
-	43: "identifier removed",
+	44: "channel number out of range",
 	70: "communication error on send",
-	77: "file descriptor in bad state",
-	51: "level 2 halted",
-	126: "required key not available",
-	22: "invalid argument",
-	108: "cannot send after transport endpoint shutdown",
-	129: "key was rejected by service",
-	81: ".lib section in a.out corrupted",
-	119: "no XENIX semaphores available",
-	60: "device not a stream",
-	75: "value too large for defined data type",
-	117: "structure needs cleaning",
-	123: "no medium found",
-	16: "device or resource busy",
-	71: "protocol error",
-	19: "no such device",
-	127: "key has expired",
-	30: "read-only file system",
-	79: "can not access a needed shared library",
-	7: "argument list too long",
-	35: "resource deadlock avoided",
+	103: "software caused connection abort",
+	111: "connection refused",
 	104: "connection reset by peer",
-	6: "no such device or address",
-	56: "invalid request code",
-	36: "file name too long",
-	94: "socket type not supported",
+	35: "resource deadlock avoided",
+	89: "destination address required",
+	33: "numerical argument out of domain",
 	73: "RFS specific error",
-	99: "cannot assign requested address",
-	62: "timer expired",
-	93: "protocol not supported",
-	131: "state not recoverable",
-	5: "input/output error",
-	101: "network is unreachable",
-	18: "invalid cross-device link",
 	122: "disk quota exceeded",
-	121: "remote I/O error",
-	28: "no space left on device",
-	8: "exec format error",
-	90: "message too long",
-	33: "numerical argument out of domain",
+	17: "file exists",
+	14: "bad address",
 	27: "file too large",
-	3: "no such process",
-	44: "channel number out of range",
 	112: "host is down",
-	37: "no locks available",
-	23: "too many open files in system",
-	38: "function not implemented",
-	107: "transport endpoint is not connected",
-	95: "operation not supported",
-	69: "srmount error",
-	103: "software caused connection abort",
-	55: "no anode",
+	113: "no route to host",
+	43: "identifier removed",
+	84: "invalid or incomplete multibyte or wide character",
+	115: "operation now in progress",
+	4: "interrupted system call",
+	22: "invalid argument",
+	5: "input/output error",
 	106: "transport endpoint is already connected",
-	87: "too many users",
-	92: "protocol not available",
-	24: "too many open files",
-	105: "no buffer space available",
+	21: "is a directory",
+	120: "is a named type file",
+	127: "key has expired",
+	129: "key was rejected by service",
+	128: "key has been revoked",
+	51: "level 2 halted",
+	45: "level 2 not synchronized",
 	46: "level 3 halted",
-	14: "bad address",
-	11: "resource temporarily unavailable",
+	47: "level 3 reset",
+	79: "can not access a needed shared library",
 	80: "accessing a corrupted shared library",
-	86: "streams pipe error",
-	111: "connection refused",
+	83: "cannot exec a shared library directly",
 	82: "attempting to link in too many shared libraries",
-	17: "file exists",
-	45: "level 2 not synchronized",
+	81: ".lib section in a.out corrupted",
+	48: "link number out of range",
+	40: "too many levels of symbolic links",
+	124: "wrong medium type",
+	24: "too many open files",
+	31: "too many links",
+	90: "message too long",
+	72: "multihop attempted",
+	36: "file name too long",
+	119: "no XENIX semaphores available",
+	100: "network is down",
+	102: "network dropped connection on reset",
+	101: "network is unreachable",
+	23: "too many open files in system",
+	55: "no anode",
+	105: "no buffer space available",
+	50: "no CSI structure available",
+	61: "no data available",
+	19: "no such device",
 	2: "no such file or directory",
+	8: "exec format error",
+	126: "required key not available",
+	37: "no locks available",
+	67: "link has been severed",
+	123: "no medium found",
+	12: "cannot allocate memory",
+	42: "no message of desired type",
+	64: "machine is not on the network",
 	65: "package not installed",
-	128: "key has been revoked",
-	113: "no route to host",
-	76: "name not unique on network",
+	92: "protocol not available",
+	28: "no space left on device",
+	63: "out of streams resources",
+	60: "device not a stream",
+	38: "function not implemented",
+	15: "block device required",
+	107: "transport endpoint is not connected",
 	20: "not a directory",
-	124: "wrong medium type",
+	39: "directory not empty",
+	118: "not a XENIX named type file",
+	131: "state not recoverable",
+	88: "socket operation on non-socket",
+	95: "operation not supported",
+	25: "inappropriate ioctl for device",
+	76: "name not unique on network",
+	6: "no such device or address",
+	75: "value too large for defined data type",
+	130: "owner died",
+	1: "operation not permitted",
+	96: "protocol family not supported",
+	32: "broken pipe",
+	71: "protocol error",
+	93: "protocol not supported",
+	91: "protocol wrong type for socket",
+	34: "numerical result out of range",
+	78: "remote address changed",
+	66: "object is remote",
+	121: "remote I/O error",
+	85: "interrupted system call should be restarted",
+	132: "unknown error 132",
+	30: "read-only file system",
+	108: "cannot send after transport endpoint shutdown",
+	94: "socket type not supported",
+	29: "illegal seek",
+	3: "no such process",
+	69: "srmount error",
+	116: "stale NFS file handle",
+	86: "streams pipe error",
+	62: "timer expired",
+	110: "connection timed out",
+	109: "too many references: cannot splice",
+	26: "text file busy",
+	117: "structure needs cleaning",
+	49: "protocol driver not attached",
+	87: "too many users",
+	18: "invalid cross-device link",
+	54: "exchange full",
 }
diff --git a/src/pkg/syscall/zerrors_linux_amd64.go b/src/pkg/syscall/zerrors_linux_amd64.go
index abc449319322f648574c1a9a07d23d96245e1619..bca74b340202e42082723665156792be1e4d993e 100644
--- a/src/pkg/syscall/zerrors_linux_amd64.go
+++ b/src/pkg/syscall/zerrors_linux_amd64.go
@@ -16,27 +16,34 @@ const (
 	AF_AX25					= 0x3;
 	AF_BLUETOOTH				= 0x1f;
 	AF_BRIDGE				= 0x7;
+	AF_CAN					= 0x1d;
 	AF_DECnet				= 0xc;
 	AF_ECONET				= 0x13;
 	AF_FILE					= 0x1;
+	AF_IEEE802154				= 0x24;
 	AF_INET					= 0x2;
 	AF_INET6				= 0xa;
 	AF_IPX					= 0x4;
 	AF_IRDA					= 0x17;
+	AF_ISDN					= 0x22;
 	AF_IUCV					= 0x20;
 	AF_KEY					= 0xf;
+	AF_LLC					= 0x1a;
 	AF_LOCAL				= 0x1;
-	AF_MAX					= 0x22;
+	AF_MAX					= 0x25;
 	AF_NETBEUI				= 0xd;
 	AF_NETLINK				= 0x10;
 	AF_NETROM				= 0x6;
 	AF_PACKET				= 0x11;
+	AF_PHONET				= 0x23;
 	AF_PPPOX				= 0x18;
+	AF_RDS					= 0x15;
 	AF_ROSE					= 0xb;
 	AF_ROUTE				= 0x10;
 	AF_RXRPC				= 0x21;
 	AF_SECURITY				= 0xe;
 	AF_SNA					= 0x16;
+	AF_TIPC					= 0x1e;
 	AF_UNIX					= 0x1;
 	AF_UNSPEC				= 0;
 	AF_WANPIPE				= 0x19;
@@ -160,9 +167,11 @@ const (
 	EPOLLRDNORM				= 0x40;
 	EPOLLWRBAND				= 0x200;
 	EPOLLWRNORM				= 0x100;
+	EPOLL_CLOEXEC				= 0x80000;
 	EPOLL_CTL_ADD				= 0x1;
 	EPOLL_CTL_DEL				= 0x2;
 	EPOLL_CTL_MOD				= 0x3;
+	EPOLL_NONBLOCK				= 0x800;
 	EPROTO					= 0x47;
 	EPROTONOSUPPORT				= 0x5d;
 	EPROTOTYPE				= 0x5b;
@@ -171,6 +180,7 @@ const (
 	EREMOTE					= 0x42;
 	EREMOTEIO				= 0x79;
 	ERESTART				= 0x55;
+	ERFKILL					= 0x84;
 	EROFS					= 0x1e;
 	ESHUTDOWN				= 0x6c;
 	ESOCKTNOSUPPORT				= 0x5e;
@@ -189,7 +199,6 @@ const (
 	EWOULDBLOCK				= 0xb;
 	EXDEV					= 0x12;
 	EXFULL					= 0x36;
-	EXPR_NEST_MAX				= 0x20;
 	FD_CLOEXEC				= 0x1;
 	FD_SETSIZE				= 0x400;
 	F_DUPFD					= 0;
@@ -223,6 +232,7 @@ const (
 	F_WRLCK					= 0x1;
 	IPPROTO_AH				= 0x33;
 	IPPROTO_COMP				= 0x6c;
+	IPPROTO_DCCP				= 0x21;
 	IPPROTO_DSTOPTS				= 0x3c;
 	IPPROTO_EGP				= 0x8;
 	IPPROTO_ENCAP				= 0x62;
@@ -248,6 +258,7 @@ const (
 	IPPROTO_TCP				= 0x6;
 	IPPROTO_TP				= 0x1d;
 	IPPROTO_UDP				= 0x11;
+	IPPROTO_UDPLITE				= 0x88;
 	IP_ADD_MEMBERSHIP			= 0x23;
 	IP_ADD_SOURCE_MEMBERSHIP		= 0x27;
 	IP_BLOCK_SOURCE				= 0x26;
@@ -268,6 +279,7 @@ const (
 	IP_PMTUDISC				= 0xa;
 	IP_PMTUDISC_DO				= 0x2;
 	IP_PMTUDISC_DONT			= 0;
+	IP_PMTUDISC_PROBE			= 0x3;
 	IP_PMTUDISC_WANT			= 0x1;
 	IP_RECVERR				= 0xb;
 	IP_RECVOPTS				= 0x6;
@@ -304,6 +316,16 @@ const (
 	O_WRONLY				= 0x1;
 	PTRACE_ARCH_PRCTL			= 0x1e;
 	PTRACE_ATTACH				= 0x10;
+	PTRACE_BTS_CLEAR			= 0x2c;
+	PTRACE_BTS_CONFIG			= 0x28;
+	PTRACE_BTS_DRAIN			= 0x2d;
+	PTRACE_BTS_GET				= 0x2b;
+	PTRACE_BTS_O_ALLOC			= 0x8;
+	PTRACE_BTS_O_SCHED			= 0x2;
+	PTRACE_BTS_O_SIGNAL			= 0x4;
+	PTRACE_BTS_O_TRACE			= 0x1;
+	PTRACE_BTS_SIZE				= 0x2a;
+	PTRACE_BTS_STATUS			= 0x29;
 	PTRACE_CONT				= 0x7;
 	PTRACE_DETACH				= 0x11;
 	PTRACE_EVENT_CLONE			= 0x3;
@@ -340,9 +362,15 @@ const (
 	PTRACE_SETREGS				= 0xd;
 	PTRACE_SETSIGINFO			= 0x4203;
 	PTRACE_SET_THREAD_AREA			= 0x1a;
+	PTRACE_SINGLEBLOCK			= 0x21;
 	PTRACE_SINGLESTEP			= 0x9;
 	PTRACE_SYSCALL				= 0x18;
+	PTRACE_SYSEMU				= 0x1f;
+	PTRACE_SYSEMU_SINGLESTEP		= 0x20;
 	PTRACE_TRACEME				= 0;
+	SHUT_RD					= 0;
+	SHUT_RDWR				= 0x2;
+	SHUT_WR					= 0x1;
 	SIGABRT					= 0x6;
 	SIGALRM					= 0xe;
 	SIGBUS					= 0x7;
@@ -378,7 +406,10 @@ const (
 	SIGWINCH				= 0x1c;
 	SIGXCPU					= 0x18;
 	SIGXFSZ					= 0x19;
+	SOCK_CLOEXEC				= 0x80000;
+	SOCK_DCCP				= 0x6;
 	SOCK_DGRAM				= 0x2;
+	SOCK_NONBLOCK				= 0x800;
 	SOCK_PACKET				= 0xa;
 	SOCK_RAW				= 0x3;
 	SOCK_RDM				= 0x4;
@@ -408,6 +439,7 @@ const (
 	SO_ERROR				= 0x4;
 	SO_KEEPALIVE				= 0x9;
 	SO_LINGER				= 0xd;
+	SO_MARK					= 0x24;
 	SO_NO_CHECK				= 0xb;
 	SO_OOBINLINE				= 0xa;
 	SO_PASSCRED				= 0x10;
@@ -429,6 +461,7 @@ const (
 	SO_SNDLOWAT				= 0x13;
 	SO_SNDTIMEO				= 0x15;
 	SO_TIMESTAMP				= 0x1d;
+	SO_TIMESTAMPING				= 0x25;
 	SO_TIMESTAMPNS				= 0x23;
 	SO_TYPE					= 0x3;
 	S_BLKSIZE				= 0x200;
@@ -493,133 +526,134 @@ const (
 
 // Error table
 var errors = [...]string{
-	72: "multihop attempted",
-	49: "protocol driver not attached",
-	97: "address family not supported by protocol",
-	78: "remote address changed",
+	7: "argument list too long",
 	13: "permission denied",
-	47: "level 3 reset",
-	89: "destination address required",
-	84: "invalid or incomplete multibyte or wide character",
-	29: "illegal seek",
-	31: "too many links",
-	130: "owner died",
-	25: "inappropriate ioctl for device",
+	98: "address already in use",
+	99: "cannot assign requested address",
+	68: "advertise error",
+	97: "address family not supported by protocol",
+	11: "resource temporarily unavailable",
+	114: "operation already in progress",
 	52: "invalid exchange",
 	9: "bad file descriptor",
+	77: "file descriptor in bad state",
+	74: "bad message",
 	53: "invalid request descriptor",
-	68: "advertise error",
-	34: "numerical result out of range",
+	56: "invalid request code",
+	57: "invalid slot",
+	59: "bad font file format",
+	16: "device or resource busy",
 	125: "operation canceled",
-	26: "text file busy",
-	12: "cannot allocate memory",
-	115: "operation now in progress",
-	15: "block device required",
-	91: "protocol wrong type for socket",
-	85: "interrupted system call should be restarted",
-	120: "is a named type file",
-	42: "no message of desired type",
-	114: "operation already in progress",
-	110: "connection timed out",
-	61: "no data available",
-	4: "interrupted system call",
-	67: "link has been severed",
-	1: "operation not permitted",
-	40: "too many levels of symbolic links",
-	100: "network is down",
-	116: "stale NFS file handle",
-	88: "socket operation on non-socket",
-	63: "out of streams resources",
 	10: "no child processes",
-	48: "link number out of range",
-	32: "broken pipe",
-	74: "bad message",
-	59: "bad font file format",
-	66: "object is remote",
-	109: "too many references: cannot splice",
-	96: "protocol family not supported",
-	64: "machine is not on the network",
-	54: "exchange full",
-	57: "invalid slot",
-	118: "not a XENIX named type file",
-	83: "cannot exec a shared library directly",
-	50: "no CSI structure available",
-	39: "directory not empty",
-	98: "address already in use",
-	102: "network dropped connection on reset",
-	21: "is a directory",
-	43: "identifier removed",
+	44: "channel number out of range",
 	70: "communication error on send",
-	77: "file descriptor in bad state",
-	51: "level 2 halted",
-	126: "required key not available",
-	22: "invalid argument",
-	108: "cannot send after transport endpoint shutdown",
-	129: "key was rejected by service",
-	81: ".lib section in a.out corrupted",
-	119: "no XENIX semaphores available",
-	60: "device not a stream",
-	75: "value too large for defined data type",
-	117: "structure needs cleaning",
-	123: "no medium found",
-	16: "device or resource busy",
-	71: "protocol error",
-	19: "no such device",
-	127: "key has expired",
-	30: "read-only file system",
-	79: "can not access a needed shared library",
-	7: "argument list too long",
-	35: "resource deadlock avoided",
+	103: "software caused connection abort",
+	111: "connection refused",
 	104: "connection reset by peer",
-	6: "no such device or address",
-	56: "invalid request code",
-	36: "file name too long",
-	94: "socket type not supported",
+	35: "resource deadlock avoided",
+	89: "destination address required",
+	33: "numerical argument out of domain",
 	73: "RFS specific error",
-	99: "cannot assign requested address",
-	62: "timer expired",
-	93: "protocol not supported",
-	131: "state not recoverable",
-	5: "input/output error",
-	101: "network is unreachable",
-	18: "invalid cross-device link",
 	122: "disk quota exceeded",
-	121: "remote I/O error",
-	28: "no space left on device",
-	8: "exec format error",
-	90: "message too long",
-	33: "numerical argument out of domain",
+	17: "file exists",
+	14: "bad address",
 	27: "file too large",
-	3: "no such process",
-	44: "channel number out of range",
 	112: "host is down",
-	37: "no locks available",
-	23: "too many open files in system",
-	38: "function not implemented",
-	107: "transport endpoint is not connected",
-	95: "operation not supported",
-	69: "srmount error",
-	103: "software caused connection abort",
-	55: "no anode",
+	113: "no route to host",
+	43: "identifier removed",
+	84: "invalid or incomplete multibyte or wide character",
+	115: "operation now in progress",
+	4: "interrupted system call",
+	22: "invalid argument",
+	5: "input/output error",
 	106: "transport endpoint is already connected",
-	87: "too many users",
-	92: "protocol not available",
-	24: "too many open files",
-	105: "no buffer space available",
+	21: "is a directory",
+	120: "is a named type file",
+	127: "key has expired",
+	129: "key was rejected by service",
+	128: "key has been revoked",
+	51: "level 2 halted",
+	45: "level 2 not synchronized",
 	46: "level 3 halted",
-	14: "bad address",
-	11: "resource temporarily unavailable",
+	47: "level 3 reset",
+	79: "can not access a needed shared library",
 	80: "accessing a corrupted shared library",
-	86: "streams pipe error",
-	111: "connection refused",
+	83: "cannot exec a shared library directly",
 	82: "attempting to link in too many shared libraries",
-	17: "file exists",
-	45: "level 2 not synchronized",
+	81: ".lib section in a.out corrupted",
+	48: "link number out of range",
+	40: "too many levels of symbolic links",
+	124: "wrong medium type",
+	24: "too many open files",
+	31: "too many links",
+	90: "message too long",
+	72: "multihop attempted",
+	36: "file name too long",
+	119: "no XENIX semaphores available",
+	100: "network is down",
+	102: "network dropped connection on reset",
+	101: "network is unreachable",
+	23: "too many open files in system",
+	55: "no anode",
+	105: "no buffer space available",
+	50: "no CSI structure available",
+	61: "no data available",
+	19: "no such device",
 	2: "no such file or directory",
+	8: "exec format error",
+	126: "required key not available",
+	37: "no locks available",
+	67: "link has been severed",
+	123: "no medium found",
+	12: "cannot allocate memory",
+	42: "no message of desired type",
+	64: "machine is not on the network",
 	65: "package not installed",
-	128: "key has been revoked",
-	113: "no route to host",
-	76: "name not unique on network",
+	92: "protocol not available",
+	28: "no space left on device",
+	63: "out of streams resources",
+	60: "device not a stream",
+	38: "function not implemented",
+	15: "block device required",
+	107: "transport endpoint is not connected",
 	20: "not a directory",
-	124: "wrong medium type",
+	39: "directory not empty",
+	118: "not a XENIX named type file",
+	131: "state not recoverable",
+	88: "socket operation on non-socket",
+	95: "operation not supported",
+	25: "inappropriate ioctl for device",
+	76: "name not unique on network",
+	6: "no such device or address",
+	75: "value too large for defined data type",
+	130: "owner died",
+	1: "operation not permitted",
+	96: "protocol family not supported",
+	32: "broken pipe",
+	71: "protocol error",
+	93: "protocol not supported",
+	91: "protocol wrong type for socket",
+	34: "numerical result out of range",
+	78: "remote address changed",
+	66: "object is remote",
+	121: "remote I/O error",
+	85: "interrupted system call should be restarted",
+	132: "unknown error 132",
+	30: "read-only file system",
+	108: "cannot send after transport endpoint shutdown",
+	94: "socket type not supported",
+	29: "illegal seek",
+	3: "no such process",
+	69: "srmount error",
+	116: "stale NFS file handle",
+	86: "streams pipe error",
+	62: "timer expired",
+	110: "connection timed out",
+	109: "too many references: cannot splice",
+	26: "text file busy",
+	117: "structure needs cleaning",
+	49: "protocol driver not attached",
+	87: "too many users",
+	18: "invalid cross-device link",
+	54: "exchange full",
 }
diff --git a/src/pkg/syscall/zsyscall_darwin_386.go b/src/pkg/syscall/zsyscall_darwin_386.go
index 20a0e435970a496b394bf03d1e0f015e4f9f4aa6..21322f62ba2e623f0a0ed39dc92bfeee138c7787 100644
--- a/src/pkg/syscall/zsyscall_darwin_386.go
+++ b/src/pkg/syscall/zsyscall_darwin_386.go
@@ -77,6 +77,12 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
 	return;
 }
 
+func Shutdown(s int, how int) (errno int) {
+	_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0);
+	errno = int(e1);
+	return;
+}
+
 func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
 	var _p0 *byte;
 	if len(p) > 0 {
diff --git a/src/pkg/syscall/zsyscall_darwin_amd64.go b/src/pkg/syscall/zsyscall_darwin_amd64.go
index f08a4b8272e81c330751250b09e3e1bb41a76051..998f008314651bdce35daf67f1630c7e6fe4c1ef 100644
--- a/src/pkg/syscall/zsyscall_darwin_amd64.go
+++ b/src/pkg/syscall/zsyscall_darwin_amd64.go
@@ -77,6 +77,12 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
 	return;
 }
 
+func Shutdown(s int, how int) (errno int) {
+	_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0);
+	errno = int(e1);
+	return;
+}
+
 func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
 	var _p0 *byte;
 	if len(p) > 0 {