aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/sys/unix/dev_freebsd.go
diff options
context:
space:
mode:
authorBo <bohende@gmail.com>2017-11-13 04:24:42 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-11-13 04:24:42 +0800
commitcb8bbe70819839e6399c44fff6a75ab3d16b8791 (patch)
tree1beb6efbe63416f7921f4914d228cc7d78b49c09 /vendor/golang.org/x/sys/unix/dev_freebsd.go
parentf47adc9ea8f16544a023ea9b67d1ed320750c5e7 (diff)
downloadgo-tangerine-cb8bbe70819839e6399c44fff6a75ab3d16b8791.tar
go-tangerine-cb8bbe70819839e6399c44fff6a75ab3d16b8791.tar.gz
go-tangerine-cb8bbe70819839e6399c44fff6a75ab3d16b8791.tar.bz2
go-tangerine-cb8bbe70819839e6399c44fff6a75ab3d16b8791.tar.lz
go-tangerine-cb8bbe70819839e6399c44fff6a75ab3d16b8791.tar.xz
go-tangerine-cb8bbe70819839e6399c44fff6a75ab3d16b8791.tar.zst
go-tangerine-cb8bbe70819839e6399c44fff6a75ab3d16b8791.zip
puppeth: handle encrypted ssh keys (closes #15442) (#15443)
* cmd/puppeth: handle encrypted ssh keys * cmd/puppeth: fix unconvert linter error
Diffstat (limited to 'vendor/golang.org/x/sys/unix/dev_freebsd.go')
-rw-r--r--vendor/golang.org/x/sys/unix/dev_freebsd.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/unix/dev_freebsd.go b/vendor/golang.org/x/sys/unix/dev_freebsd.go
new file mode 100644
index 000000000..eba3b4bd3
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/dev_freebsd.go
@@ -0,0 +1,30 @@
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Functions to access/create device major and minor numbers matching the
+// encoding used in FreeBSD's sys/types.h header.
+//
+// The information below is extracted and adapted from sys/types.h:
+//
+// Minor gives a cookie instead of an index since in order to avoid changing the
+// meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
+// devices that don't use them.
+
+package unix
+
+// Major returns the major component of a FreeBSD device number.
+func Major(dev uint64) uint32 {
+ return uint32((dev >> 8) & 0xff)
+}
+
+// Minor returns the minor component of a FreeBSD device number.
+func Minor(dev uint64) uint32 {
+ return uint32(dev & 0xffff00ff)
+}
+
+// Mkdev returns a FreeBSD device number generated from the given major and
+// minor components.
+func Mkdev(major, minor uint32) uint64 {
+ return (uint64(major) << 8) | uint64(minor)
+}