summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/link/sharedmem/tx.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-10-13 22:24:19 +0000
committergVisor bot <gvisor-bot@google.com>2021-10-13 22:24:19 +0000
commitcb091cfa76c99fea029ef56ddfaa89000ab7d174 (patch)
treeb4b8e4f35d17a782d8f9b804b994c612f2ae7cc7 /pkg/tcpip/link/sharedmem/tx.go
parentf29bd12489ad6463533f23dfa840b7c56047b25c (diff)
parent4e2cc2bef3220bb77a60b4a33fb02f491d5acf98 (diff)
Merge release-20210927.0-71-g4e2cc2bef (automated)
Diffstat (limited to 'pkg/tcpip/link/sharedmem/tx.go')
-rw-r--r--pkg/tcpip/link/sharedmem/tx.go16
1 files changed, 0 insertions, 16 deletions
diff --git a/pkg/tcpip/link/sharedmem/tx.go b/pkg/tcpip/link/sharedmem/tx.go
index 35e5bff12..d6c61afee 100644
--- a/pkg/tcpip/link/sharedmem/tx.go
+++ b/pkg/tcpip/link/sharedmem/tx.go
@@ -152,22 +152,6 @@ func (t *tx) notify() {
t.eventFD.Notify()
}
-// getBuffer returns a memory region mapped to the full contents of the given
-// file descriptor.
-func getBuffer(fd int) ([]byte, error) {
- var s unix.Stat_t
- if err := unix.Fstat(fd, &s); err != nil {
- return nil, err
- }
-
- // Check that size doesn't overflow an int.
- if s.Size > int64(^uint(0)>>1) {
- return nil, unix.EDOM
- }
-
- return unix.Mmap(fd, 0, int(s.Size), unix.PROT_READ|unix.PROT_WRITE, unix.MAP_SHARED|unix.MAP_FILE)
-}
-
// idDescriptor is used by idManager to either point to a tx buffer (in case
// the ID is assigned) or to the next free element (if the id is not assigned).
type idDescriptor struct {