github.com/aristanetworks/goarista@v0.0.0-20240514173732-cca2755bbd44/netns/netns_other.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  //go:build !linux
     6  // +build !linux
     7  
     8  package netns
     9  
    10  // stub: close closes the file descriptor mapped to a network namespace
    11  func (h nsHandle) close() error {
    12  	return nil
    13  }
    14  
    15  // stub: fd returns the handle as a uintptr
    16  func (h nsHandle) fd() int {
    17  	return 0
    18  }
    19  
    20  // stub: getNs returns a file descriptor mapping to the given network namespace
    21  var getNs = func(nsName string) (handle, error) {
    22  	return nsHandle(1), nil
    23  }
    24  
    25  // stub: setNs sets the process's network namespace
    26  var setNs = func(fd handle) error {
    27  	return nil
    28  }