From 0624858593847096b68ecbd262e2cae6ea79048a Mon Sep 17 00:00:00 2001 From: Haibo Xu Date: Thu, 15 Aug 2019 02:04:47 +0000 Subject: Rename rawfile/blockingpoll_unsafe.go to rawfile/blockingpoll_stub_unsafe.go. Signed-off-by: Haibo Xu haibo.xu@arm.com Change-Id: I2376e502c1a860d5e624c8a8e3afab5da4c53022 --- pkg/tcpip/link/rawfile/BUILD | 2 +- pkg/tcpip/link/rawfile/blockingpoll_stub_unsafe.go | 31 ++++++++++++++++++++++ pkg/tcpip/link/rawfile/blockingpoll_unsafe.go | 31 ---------------------- 3 files changed, 32 insertions(+), 32 deletions(-) create mode 100644 pkg/tcpip/link/rawfile/blockingpoll_stub_unsafe.go delete mode 100644 pkg/tcpip/link/rawfile/blockingpoll_unsafe.go (limited to 'pkg/tcpip/link/rawfile') diff --git a/pkg/tcpip/link/rawfile/BUILD b/pkg/tcpip/link/rawfile/BUILD index 6e3a7a9d7..58aee1a7b 100644 --- a/pkg/tcpip/link/rawfile/BUILD +++ b/pkg/tcpip/link/rawfile/BUILD @@ -7,7 +7,7 @@ go_library( srcs = [ "blockingpoll_amd64.s", "blockingpoll_amd64_unsafe.go", - "blockingpoll_unsafe.go", + "blockingpoll_stub_unsafe.go", "errors.go", "rawfile_unsafe.go", ], diff --git a/pkg/tcpip/link/rawfile/blockingpoll_stub_unsafe.go b/pkg/tcpip/link/rawfile/blockingpoll_stub_unsafe.go new file mode 100644 index 000000000..84dc0e918 --- /dev/null +++ b/pkg/tcpip/link/rawfile/blockingpoll_stub_unsafe.go @@ -0,0 +1,31 @@ +// Copyright 2018 The gVisor Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +build linux,!amd64 + +package rawfile + +import ( + "syscall" + "unsafe" +) + +// BlockingPoll is just a stub function that forwards to the ppoll() system call +// on non-amd64 platforms. +func BlockingPoll(fds *PollEvent, nfds int, timeout *syscall.Timespec) (int, syscall.Errno) { + n, _, e := syscall.Syscall6(syscall.SYS_PPOLL, uintptr(unsafe.Pointer(fds)), + uintptr(nfds), uintptr(unsafe.Pointer(timeout)), 0, 0, 0) + + return int(n), e +} diff --git a/pkg/tcpip/link/rawfile/blockingpoll_unsafe.go b/pkg/tcpip/link/rawfile/blockingpoll_unsafe.go deleted file mode 100644 index 84dc0e918..000000000 --- a/pkg/tcpip/link/rawfile/blockingpoll_unsafe.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2018 The gVisor Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// +build linux,!amd64 - -package rawfile - -import ( - "syscall" - "unsafe" -) - -// BlockingPoll is just a stub function that forwards to the ppoll() system call -// on non-amd64 platforms. -func BlockingPoll(fds *PollEvent, nfds int, timeout *syscall.Timespec) (int, syscall.Errno) { - n, _, e := syscall.Syscall6(syscall.SYS_PPOLL, uintptr(unsafe.Pointer(fds)), - uintptr(nfds), uintptr(unsafe.Pointer(timeout)), 0, 0, 0) - - return int(n), e -} -- cgit v1.2.3