mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-05 08:37:31 -04:00
unix: add Major, Minor and Mkdev functions on Solaris
Add Major, Minor and Mkdev functions for converting device numbers to their major/minor components and vice versa. Use the respective functions provided by the Solaris libc instead of reimplementing them. Test the conversion function with some well-known static device numbers for devices which should be present on any Solaris system. Re-generated files on OpenIndiana Hipster 2017.04 (SunOS 5.11) which also added some previously missing error constants. Change-Id: Ief9ea973d91c24956571eb8fafc8a4525b0f5b90 Reviewed-on: https://go-review.googlesource.com/64390 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
committed by
Ian Lance Taylor
parent
b8ca6dd53d
commit
1f337fdb7f
@@ -514,6 +514,24 @@ func Acct(path string) (err error) {
|
||||
return acct(pathp)
|
||||
}
|
||||
|
||||
//sys __makedev(version int, major uint, minor uint) (val uint64)
|
||||
|
||||
func Mkdev(major, minor uint32) uint64 {
|
||||
return __makedev(NEWDEV, uint(major), uint(minor))
|
||||
}
|
||||
|
||||
//sys __major(version int, dev uint64) (val uint)
|
||||
|
||||
func Major(dev uint64) uint32 {
|
||||
return uint32(__major(NEWDEV, dev))
|
||||
}
|
||||
|
||||
//sys __minor(version int, dev uint64) (val uint)
|
||||
|
||||
func Minor(dev uint64) uint32 {
|
||||
return uint32(__minor(NEWDEV, dev))
|
||||
}
|
||||
|
||||
/*
|
||||
* Expose the ioctl function
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user