From e3e4a5610ce5e8fca4527f8a0e391c44f4353aab Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Tue, 2 Jun 2015 18:21:04 +0100 Subject: [PATCH] Remove dead code Sir Codus Cleanupus vs. system.go "This code doth offend me so" uttered Sir Codus Cleanupus "and thus it must be cleft swiftly in twain". With one hefty stroke of his broadsword he carved the old, unfunctioning code in half and thus it ceased to be. Signed-off-by: Dave Tucker --- system.go | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 system.go diff --git a/system.go b/system.go deleted file mode 100644 index 7beec28..0000000 --- a/system.go +++ /dev/null @@ -1,34 +0,0 @@ -package libnetwork - -import ( - "fmt" - "runtime" - "syscall" -) - -// Via http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7b21fddd087678a70ad64afc0f632e0f1071b092 -// -// We need different setns values for the different platforms and arch -// We are declaring the macro here because the SETNS syscall does not exist in th stdlib -var setNsMap = map[string]uintptr{ - "linux/386": 346, - "linux/amd64": 308, - "linux/arm": 374, - "linux/ppc64": 350, - "linux/ppc64le": 350, - "linux/s390x": 339, -} - -func setns(fd uintptr, flags uintptr) error { - ns, exists := setNsMap[fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)] - if !exists { - return fmt.Errorf("unsupported platform %s/%s", runtime.GOOS, runtime.GOARCH) - } - - _, _, err := syscall.RawSyscall(ns, fd, flags, 0) - if err != 0 { - return err - } - - return nil -}