dev_aix_ppc.go 757 B

123456789101112131415161718192021222324252627
  1. // Copyright 2018 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:build aix && ppc
  5. // +build aix,ppc
  6. // Functions to access/create device major and minor numbers matching the
  7. // encoding used by AIX.
  8. package unix
  9. // Major returns the major component of a Linux device number.
  10. func Major(dev uint64) uint32 {
  11. return uint32((dev >> 16) & 0xffff)
  12. }
  13. // Minor returns the minor component of a Linux device number.
  14. func Minor(dev uint64) uint32 {
  15. return uint32(dev & 0xffff)
  16. }
  17. // Mkdev returns a Linux device number generated from the given major and minor
  18. // components.
  19. func Mkdev(major, minor uint32) uint64 {
  20. return uint64(((major) << 16) | (minor))
  21. }