summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/host/util_unsafe.go
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2020-03-17 10:29:12 -0700
committergVisor bot <gvisor-bot@google.com>2020-03-17 10:30:32 -0700
commit42d78ba61bf93f927ee89099abf5ef27b394b0d9 (patch)
treed37b629f457498704f09910000f6df6c4e06fc41 /pkg/sentry/fs/host/util_unsafe.go
parent3192e55ffe04b583ca4261ec0b04a6e566a6038b (diff)
Remove HostFS from Sentry.
PiperOrigin-RevId: 301402181
Diffstat (limited to 'pkg/sentry/fs/host/util_unsafe.go')
-rw-r--r--pkg/sentry/fs/host/util_unsafe.go41
1 files changed, 0 insertions, 41 deletions
diff --git a/pkg/sentry/fs/host/util_unsafe.go b/pkg/sentry/fs/host/util_unsafe.go
index 3ab36b088..23bd35d64 100644
--- a/pkg/sentry/fs/host/util_unsafe.go
+++ b/pkg/sentry/fs/host/util_unsafe.go
@@ -26,26 +26,6 @@ import (
// NulByte is a single NUL byte. It is passed to readlinkat as an empty string.
var NulByte byte = '\x00'
-func createLink(fd int, name string, linkName string) error {
- namePtr, err := syscall.BytePtrFromString(name)
- if err != nil {
- return err
- }
- linkNamePtr, err := syscall.BytePtrFromString(linkName)
- if err != nil {
- return err
- }
- _, _, errno := syscall.Syscall(
- syscall.SYS_SYMLINKAT,
- uintptr(unsafe.Pointer(namePtr)),
- uintptr(fd),
- uintptr(unsafe.Pointer(linkNamePtr)))
- if errno != 0 {
- return errno
- }
- return nil
-}
-
func readLink(fd int) (string, error) {
// Buffer sizing copied from os.Readlink.
for l := 128; ; l *= 2 {
@@ -66,27 +46,6 @@ func readLink(fd int) (string, error) {
}
}
-func unlinkAt(fd int, name string, dir bool) error {
- namePtr, err := syscall.BytePtrFromString(name)
- if err != nil {
- return err
- }
- var flags uintptr
- if dir {
- flags = linux.AT_REMOVEDIR
- }
- _, _, errno := syscall.Syscall(
- syscall.SYS_UNLINKAT,
- uintptr(fd),
- uintptr(unsafe.Pointer(namePtr)),
- flags,
- )
- if errno != 0 {
- return errno
- }
- return nil
-}
-
func timespecFromTimestamp(t ktime.Time, omit, setSysTime bool) syscall.Timespec {
if omit {
return syscall.Timespec{0, linux.UTIME_OMIT}