github.com/psiphon-inc/goarista@v0.0.0-20160825065156-d002785f4c67/netns/netns_darwin.go (about)

     1  // Copyright (C) 2016  Arista Networks, Inc.
     2  // Use of this source code is governed by the Apache License 2.0
     3  // that can be found in the COPYING file.
     4  
     5  package netns
     6  
     7  // stub: close closes the file descriptor mapped to a network namespace
     8  func (h nsHandle) close() error {
     9  	return nil
    10  }
    11  
    12  // stub: fd returns the handle as a uintptr
    13  func (h nsHandle) fd() int {
    14  	return 0
    15  }
    16  
    17  // stub: getNs returns a file descriptor mapping to the given network namespace
    18  var getNs = func(nsName string) (handle, error) {
    19  	return nsHandle(1), nil
    20  }
    21  
    22  // stub: setNs sets the process's network namespace
    23  var setNs = func(fd handle) error {
    24  	return nil
    25  }