From c45a08e5ba4dca55bbc4e8156092d0f8d7357ced Mon Sep 17 00:00:00 2001 From: Albert Strasheim Date: Wed, 6 Apr 2011 16:19:22 -0400 Subject: [PATCH] syscall: Add DT_* and MADV_* constants on Linux. R=rsc, agl1 CC=golang-dev https://golang.org/cl/4370041 --- src/pkg/syscall/mkerrors.sh | 2 +- src/pkg/syscall/zerrors_linux_386.go | 20 ++++++++++++++++++++ src/pkg/syscall/zerrors_linux_amd64.go | 20 ++++++++++++++++++++ src/pkg/syscall/zsysnum_linux_386.go | 2 +- src/pkg/syscall/zsysnum_linux_amd64.go | 2 +- 5 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/pkg/syscall/mkerrors.sh b/src/pkg/syscall/mkerrors.sh index 2f1c7512fe..9bb359fc0c 100755 --- a/src/pkg/syscall/mkerrors.sh +++ b/src/pkg/syscall/mkerrors.sh @@ -119,7 +119,7 @@ done $2 ~ /^E[A-Z0-9_]+$/ || $2 ~ /^SIG[^_]/ || $2 ~ /^IN_/ || - $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|EVFILT|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|MCL)_/ || + $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|EVFILT|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV)_/ || $2 == "SOMAXCONN" || $2 == "NAME_MAX" || $2 == "IFNAMSIZ" || diff --git a/src/pkg/syscall/zerrors_linux_386.go b/src/pkg/syscall/zerrors_linux_386.go index a0e14b2a37..3fc7cc7383 100644 --- a/src/pkg/syscall/zerrors_linux_386.go +++ b/src/pkg/syscall/zerrors_linux_386.go @@ -48,6 +48,15 @@ const ( AF_UNSPEC = 0 AF_WANPIPE = 0x19 AF_X25 = 0x9 + DT_BLK = 0x6 + DT_CHR = 0x2 + DT_DIR = 0x4 + DT_FIFO = 0x1 + DT_LNK = 0xa + DT_REG = 0x8 + DT_SOCK = 0xc + DT_UNKNOWN = 0 + DT_WHT = 0xe E2BIG = 0x7 EACCES = 0xd EADDRINUSE = 0x62 @@ -418,6 +427,17 @@ const ( LINUX_REBOOT_CMD_SW_SUSPEND = 0xd000fce2 LINUX_REBOOT_MAGIC1 = 0xfee1dead LINUX_REBOOT_MAGIC2 = 0x28121969 + MADV_DOFORK = 0xb + MADV_DONTFORK = 0xa + MADV_DONTNEED = 0x4 + MADV_HWPOISON = 0x64 + MADV_MERGEABLE = 0xc + MADV_NORMAL = 0 + MADV_RANDOM = 0x1 + MADV_REMOVE = 0x9 + MADV_SEQUENTIAL = 0x2 + MADV_UNMERGEABLE = 0xd + MADV_WILLNEED = 0x3 MAP_32BIT = 0x40 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 diff --git a/src/pkg/syscall/zerrors_linux_amd64.go b/src/pkg/syscall/zerrors_linux_amd64.go index 122ac8b79c..d5efdf55d6 100644 --- a/src/pkg/syscall/zerrors_linux_amd64.go +++ b/src/pkg/syscall/zerrors_linux_amd64.go @@ -48,6 +48,15 @@ const ( AF_UNSPEC = 0 AF_WANPIPE = 0x19 AF_X25 = 0x9 + DT_BLK = 0x6 + DT_CHR = 0x2 + DT_DIR = 0x4 + DT_FIFO = 0x1 + DT_LNK = 0xa + DT_REG = 0x8 + DT_SOCK = 0xc + DT_UNKNOWN = 0 + DT_WHT = 0xe E2BIG = 0x7 EACCES = 0xd EADDRINUSE = 0x62 @@ -418,6 +427,17 @@ const ( LINUX_REBOOT_CMD_SW_SUSPEND = 0xd000fce2 LINUX_REBOOT_MAGIC1 = 0xfee1dead LINUX_REBOOT_MAGIC2 = 0x28121969 + MADV_DOFORK = 0xb + MADV_DONTFORK = 0xa + MADV_DONTNEED = 0x4 + MADV_HWPOISON = 0x64 + MADV_MERGEABLE = 0xc + MADV_NORMAL = 0 + MADV_RANDOM = 0x1 + MADV_REMOVE = 0x9 + MADV_SEQUENTIAL = 0x2 + MADV_UNMERGEABLE = 0xd + MADV_WILLNEED = 0x3 MAP_32BIT = 0x40 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 diff --git a/src/pkg/syscall/zsysnum_linux_386.go b/src/pkg/syscall/zsysnum_linux_386.go index 55529adaa7..71e21c7a58 100644 --- a/src/pkg/syscall/zsysnum_linux_386.go +++ b/src/pkg/syscall/zsysnum_linux_386.go @@ -1,4 +1,4 @@ -// mksysnum_linux.sh /usr/include/asm/unistd_32.h +// mksysnum_linux.pl /usr/include/asm/unistd_32.h // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT package syscall diff --git a/src/pkg/syscall/zsysnum_linux_amd64.go b/src/pkg/syscall/zsysnum_linux_amd64.go index 2621999c75..77d4eea9e7 100644 --- a/src/pkg/syscall/zsysnum_linux_amd64.go +++ b/src/pkg/syscall/zsysnum_linux_amd64.go @@ -1,4 +1,4 @@ -// mksysnum_linux.sh /usr/include/asm/unistd_64.h +// mksysnum_linux.pl /usr/include/asm/unistd_64.h // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT package syscall