-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvjhandle_others.go
More file actions
41 lines (33 loc) · 1017 Bytes
/
vjhandle_others.go
File metadata and controls
41 lines (33 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//go:build !freebsd
// +build !freebsd
package vnet
type VjHandle int
func (vj VjHandle) Equal(_ VjHandle) bool {
return false
}
// String shows the file descriptor number and its dev and inode.
// It is only implemented on Linux, and returns "NS(none)" on other
// platforms.
func (vj VjHandle) String() string {
return "NS(none)"
}
// UniqueId returns a string which uniquely identifies the namespace
// associated with the network handle. It is only implemented on Linux,
// and returns "NS(none)" on other platforms.
func (vj VjHandle) UniqueId() string {
return "NS(none)"
}
// IsOpen returns true if Close() has not been called. It is only implemented
// on Linux and always returns false on other platforms.
func (vj VjHandle) IsOpen() bool {
return false
}
// Close closes the NsHandle and resets its file descriptor to -1.
// It is only implemented on Linux.
func (vj *VjHandle) Close() error {
return nil
}
// None gets an empty (closed) NsHandle.
func None() VjHandle {
return VjHandle(-1)
}