From a3c35430fc0a67b5c8af6d57d21e2881929076ac Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Fri, 16 Feb 2024 14:32:27 +0800 Subject: [PATCH] runtime/internal/syscall: merge duplicate constants Change-Id: Ifdc6e22d52317cdb90a607ac4d72437d4d6b33e8 Reviewed-on: https://go-review.googlesource.com/c/go/+/564716 Auto-Submit: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Reviewed-by: Than McIntosh Reviewed-by: Ian Lance Taylor --- src/runtime/internal/syscall/defs_linux.go | 12 +++++++++++- src/runtime/internal/syscall/defs_linux_386.go | 12 +----------- src/runtime/internal/syscall/defs_linux_amd64.go | 12 +----------- src/runtime/internal/syscall/defs_linux_arm.go | 12 +----------- src/runtime/internal/syscall/defs_linux_arm64.go | 12 +----------- src/runtime/internal/syscall/defs_linux_loong64.go | 12 +----------- src/runtime/internal/syscall/defs_linux_mips64x.go | 12 +----------- src/runtime/internal/syscall/defs_linux_mipsx.go | 12 +----------- src/runtime/internal/syscall/defs_linux_ppc64x.go | 12 +----------- src/runtime/internal/syscall/defs_linux_riscv64.go | 12 +----------- src/runtime/internal/syscall/defs_linux_s390x.go | 12 +----------- 11 files changed, 21 insertions(+), 111 deletions(-) diff --git a/src/runtime/internal/syscall/defs_linux.go b/src/runtime/internal/syscall/defs_linux.go index 242a67b4bc..b2e36a244f 100644 --- a/src/runtime/internal/syscall/defs_linux.go +++ b/src/runtime/internal/syscall/defs_linux.go @@ -5,5 +5,15 @@ package syscall const ( - EFD_CLOEXEC = 0x80000 + EPOLLIN = 0x1 + EPOLLOUT = 0x4 + EPOLLERR = 0x8 + EPOLLHUP = 0x10 + EPOLLRDHUP = 0x2000 + EPOLLET = 0x80000000 + EPOLL_CLOEXEC = 0x80000 + EPOLL_CTL_ADD = 0x1 + EPOLL_CTL_DEL = 0x2 + EPOLL_CTL_MOD = 0x3 + EFD_CLOEXEC = 0x80000 ) diff --git a/src/runtime/internal/syscall/defs_linux_386.go b/src/runtime/internal/syscall/defs_linux_386.go index fa0ca5ed0a..613dc77d59 100644 --- a/src/runtime/internal/syscall/defs_linux_386.go +++ b/src/runtime/internal/syscall/defs_linux_386.go @@ -12,17 +12,7 @@ const ( SYS_EPOLL_PWAIT2 = 441 SYS_EVENTFD2 = 328 - EPOLLIN = 0x1 - EPOLLOUT = 0x4 - EPOLLERR = 0x8 - EPOLLHUP = 0x10 - EPOLLRDHUP = 0x2000 - EPOLLET = 0x80000000 - EPOLL_CLOEXEC = 0x80000 - EPOLL_CTL_ADD = 0x1 - EPOLL_CTL_DEL = 0x2 - EPOLL_CTL_MOD = 0x3 - EFD_NONBLOCK = 0x800 + EFD_NONBLOCK = 0x800 ) type EpollEvent struct { diff --git a/src/runtime/internal/syscall/defs_linux_amd64.go b/src/runtime/internal/syscall/defs_linux_amd64.go index 71bd906ed4..2ba3128813 100644 --- a/src/runtime/internal/syscall/defs_linux_amd64.go +++ b/src/runtime/internal/syscall/defs_linux_amd64.go @@ -12,17 +12,7 @@ const ( SYS_EPOLL_PWAIT2 = 441 SYS_EVENTFD2 = 290 - EPOLLIN = 0x1 - EPOLLOUT = 0x4 - EPOLLERR = 0x8 - EPOLLHUP = 0x10 - EPOLLRDHUP = 0x2000 - EPOLLET = 0x80000000 - EPOLL_CLOEXEC = 0x80000 - EPOLL_CTL_ADD = 0x1 - EPOLL_CTL_DEL = 0x2 - EPOLL_CTL_MOD = 0x3 - EFD_NONBLOCK = 0x800 + EFD_NONBLOCK = 0x800 ) type EpollEvent struct { diff --git a/src/runtime/internal/syscall/defs_linux_arm.go b/src/runtime/internal/syscall/defs_linux_arm.go index 146cda5fcb..af3e0510b1 100644 --- a/src/runtime/internal/syscall/defs_linux_arm.go +++ b/src/runtime/internal/syscall/defs_linux_arm.go @@ -12,17 +12,7 @@ const ( SYS_EPOLL_PWAIT2 = 441 SYS_EVENTFD2 = 356 - EPOLLIN = 0x1 - EPOLLOUT = 0x4 - EPOLLERR = 0x8 - EPOLLHUP = 0x10 - EPOLLRDHUP = 0x2000 - EPOLLET = 0x80000000 - EPOLL_CLOEXEC = 0x80000 - EPOLL_CTL_ADD = 0x1 - EPOLL_CTL_DEL = 0x2 - EPOLL_CTL_MOD = 0x3 - EFD_NONBLOCK = 0x800 + EFD_NONBLOCK = 0x800 ) type EpollEvent struct { diff --git a/src/runtime/internal/syscall/defs_linux_arm64.go b/src/runtime/internal/syscall/defs_linux_arm64.go index 0500b317e9..c924f6211a 100644 --- a/src/runtime/internal/syscall/defs_linux_arm64.go +++ b/src/runtime/internal/syscall/defs_linux_arm64.go @@ -12,17 +12,7 @@ const ( SYS_EPOLL_PWAIT2 = 441 SYS_EVENTFD2 = 19 - EPOLLIN = 0x1 - EPOLLOUT = 0x4 - EPOLLERR = 0x8 - EPOLLHUP = 0x10 - EPOLLRDHUP = 0x2000 - EPOLLET = 0x80000000 - EPOLL_CLOEXEC = 0x80000 - EPOLL_CTL_ADD = 0x1 - EPOLL_CTL_DEL = 0x2 - EPOLL_CTL_MOD = 0x3 - EFD_NONBLOCK = 0x800 + EFD_NONBLOCK = 0x800 ) type EpollEvent struct { diff --git a/src/runtime/internal/syscall/defs_linux_loong64.go b/src/runtime/internal/syscall/defs_linux_loong64.go index 2c67b7b568..c1a5649a42 100644 --- a/src/runtime/internal/syscall/defs_linux_loong64.go +++ b/src/runtime/internal/syscall/defs_linux_loong64.go @@ -12,17 +12,7 @@ const ( SYS_EPOLL_PWAIT2 = 441 SYS_EVENTFD2 = 19 - EPOLLIN = 0x1 - EPOLLOUT = 0x4 - EPOLLERR = 0x8 - EPOLLHUP = 0x10 - EPOLLRDHUP = 0x2000 - EPOLLET = 0x80000000 - EPOLL_CLOEXEC = 0x80000 - EPOLL_CTL_ADD = 0x1 - EPOLL_CTL_DEL = 0x2 - EPOLL_CTL_MOD = 0x3 - EFD_NONBLOCK = 0x800 + EFD_NONBLOCK = 0x800 ) type EpollEvent struct { diff --git a/src/runtime/internal/syscall/defs_linux_mips64x.go b/src/runtime/internal/syscall/defs_linux_mips64x.go index 3031af241b..07c0aba539 100644 --- a/src/runtime/internal/syscall/defs_linux_mips64x.go +++ b/src/runtime/internal/syscall/defs_linux_mips64x.go @@ -14,17 +14,7 @@ const ( SYS_EPOLL_PWAIT2 = 5441 SYS_EVENTFD2 = 5284 - EPOLLIN = 0x1 - EPOLLOUT = 0x4 - EPOLLERR = 0x8 - EPOLLHUP = 0x10 - EPOLLRDHUP = 0x2000 - EPOLLET = 0x80000000 - EPOLL_CLOEXEC = 0x80000 - EPOLL_CTL_ADD = 0x1 - EPOLL_CTL_DEL = 0x2 - EPOLL_CTL_MOD = 0x3 - EFD_NONBLOCK = 0x80 + EFD_NONBLOCK = 0x80 ) type EpollEvent struct { diff --git a/src/runtime/internal/syscall/defs_linux_mipsx.go b/src/runtime/internal/syscall/defs_linux_mipsx.go index 4d51921abd..a1bb5d720a 100644 --- a/src/runtime/internal/syscall/defs_linux_mipsx.go +++ b/src/runtime/internal/syscall/defs_linux_mipsx.go @@ -14,17 +14,7 @@ const ( SYS_EPOLL_PWAIT2 = 4441 SYS_EVENTFD2 = 4325 - EPOLLIN = 0x1 - EPOLLOUT = 0x4 - EPOLLERR = 0x8 - EPOLLHUP = 0x10 - EPOLLRDHUP = 0x2000 - EPOLLET = 0x80000000 - EPOLL_CLOEXEC = 0x80000 - EPOLL_CTL_ADD = 0x1 - EPOLL_CTL_DEL = 0x2 - EPOLL_CTL_MOD = 0x3 - EFD_NONBLOCK = 0x80 + EFD_NONBLOCK = 0x80 ) type EpollEvent struct { diff --git a/src/runtime/internal/syscall/defs_linux_ppc64x.go b/src/runtime/internal/syscall/defs_linux_ppc64x.go index fcd15e60a2..78558b360f 100644 --- a/src/runtime/internal/syscall/defs_linux_ppc64x.go +++ b/src/runtime/internal/syscall/defs_linux_ppc64x.go @@ -14,17 +14,7 @@ const ( SYS_EPOLL_PWAIT2 = 441 SYS_EVENTFD2 = 314 - EPOLLIN = 0x1 - EPOLLOUT = 0x4 - EPOLLERR = 0x8 - EPOLLHUP = 0x10 - EPOLLRDHUP = 0x2000 - EPOLLET = 0x80000000 - EPOLL_CLOEXEC = 0x80000 - EPOLL_CTL_ADD = 0x1 - EPOLL_CTL_DEL = 0x2 - EPOLL_CTL_MOD = 0x3 - EFD_NONBLOCK = 0x800 + EFD_NONBLOCK = 0x800 ) type EpollEvent struct { diff --git a/src/runtime/internal/syscall/defs_linux_riscv64.go b/src/runtime/internal/syscall/defs_linux_riscv64.go index 2c67b7b568..c1a5649a42 100644 --- a/src/runtime/internal/syscall/defs_linux_riscv64.go +++ b/src/runtime/internal/syscall/defs_linux_riscv64.go @@ -12,17 +12,7 @@ const ( SYS_EPOLL_PWAIT2 = 441 SYS_EVENTFD2 = 19 - EPOLLIN = 0x1 - EPOLLOUT = 0x4 - EPOLLERR = 0x8 - EPOLLHUP = 0x10 - EPOLLRDHUP = 0x2000 - EPOLLET = 0x80000000 - EPOLL_CLOEXEC = 0x80000 - EPOLL_CTL_ADD = 0x1 - EPOLL_CTL_DEL = 0x2 - EPOLL_CTL_MOD = 0x3 - EFD_NONBLOCK = 0x800 + EFD_NONBLOCK = 0x800 ) type EpollEvent struct { diff --git a/src/runtime/internal/syscall/defs_linux_s390x.go b/src/runtime/internal/syscall/defs_linux_s390x.go index c1deed6c74..b539b2d22a 100644 --- a/src/runtime/internal/syscall/defs_linux_s390x.go +++ b/src/runtime/internal/syscall/defs_linux_s390x.go @@ -12,17 +12,7 @@ const ( SYS_EPOLL_PWAIT2 = 441 SYS_EVENTFD2 = 323 - EPOLLIN = 0x1 - EPOLLOUT = 0x4 - EPOLLERR = 0x8 - EPOLLHUP = 0x10 - EPOLLRDHUP = 0x2000 - EPOLLET = 0x80000000 - EPOLL_CLOEXEC = 0x80000 - EPOLL_CTL_ADD = 0x1 - EPOLL_CTL_DEL = 0x2 - EPOLL_CTL_MOD = 0x3 - EFD_NONBLOCK = 0x800 + EFD_NONBLOCK = 0x800 ) type EpollEvent struct { -- 2.48.1