Path: blob/main/vendor/golang.org/x/sys/unix/dev_darwin.go
2880 views
// Copyright 2017 The Go Authors. All rights reserved.1// Use of this source code is governed by a BSD-style2// license that can be found in the LICENSE file.34// Functions to access/create device major and minor numbers matching the5// encoding used in Darwin's sys/types.h header.67package unix89// Major returns the major component of a Darwin device number.10func Major(dev uint64) uint32 {11return uint32((dev >> 24) & 0xff)12}1314// Minor returns the minor component of a Darwin device number.15func Minor(dev uint64) uint32 {16return uint32(dev & 0xffffff)17}1819// Mkdev returns a Darwin device number generated from the given major and minor20// components.21func Mkdev(major, minor uint32) uint64 {22return (uint64(major) << 24) | uint64(minor)23}242526