aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/fileutil/fileutil_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/fileutil/fileutil_linux.go')
-rw-r--r--pkg/fileutil/fileutil_linux.go24
1 files changed, 0 insertions, 24 deletions
diff --git a/pkg/fileutil/fileutil_linux.go b/pkg/fileutil/fileutil_linux.go
deleted file mode 100644
index 217036256..000000000
--- a/pkg/fileutil/fileutil_linux.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2017 syzkaller project authors. All rights reserved.
-// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
-
-package fileutil
-
-import (
- "io/ioutil"
- "path/filepath"
- "syscall"
- "unsafe"
-)
-
-// UmountAll recurusively unmounts all mounts in dir.
-func UmountAll(dir string) {
- files, _ := ioutil.ReadDir(dir)
- for _, f := range files {
- name := filepath.Join(dir, f.Name())
- if f.IsDir() {
- UmountAll(name)
- }
- fn := []byte(name + "\x00")
- syscall.Syscall(syscall.SYS_UMOUNT2, uintptr(unsafe.Pointer(&fn[0])), syscall.MNT_FORCE, 0)
- }
-}