// 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 OpenBSD's sys/types.h header.packageunix// Major returns the major component of an OpenBSD device number.funcMajor(devuint64)uint32{returnuint32((dev&0x0000ff00)>>8)}// Minor returns the minor component of an OpenBSD device number.funcMinor(devuint64)uint32{minor:=uint32((dev&0x000000ff)>>0)minor|=uint32((dev&0xffff0000)>>8)returnminor}// Mkdev returns an OpenBSD device number generated from the given major and minor// components.funcMkdev(major,minoruint32)uint64{dev:=(uint64(major)<<8)&0x0000ff00dev|=(uint64(minor)<<8)&0xffff0000dev|=(uint64(minor)<<0)&0x000000ffreturndev}