Daniel Swarbrick reports the following go vet warning after CL 50550:
.../dev_linux.go:38: (major & 0xfffff000) (32 bits) too small for shift of 32
Fix it by converting major and minor to uint64 before the bitwise-and.
Change-Id: If37540be81f2c78a58fd5e5dcce7b770ce7b8afe
Reviewed-on: https://go-review.googlesource.com/63090
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Add Major, Minor and Mkdev functions for converting devices numbers to
their major/minor components and vice versa.
The functions follow the behavior of glibc's corresponding macros. Also
add an explanatory comment about the device number format, so the magic
numbers make more sense.
Test the conversion macros with some well-known device numbers for
devices which should be present on any Linux system.
Fixesgolang/go#8106
Change-Id: Id336317985d6ac85ee83bc54e5f23703257c9121
Reviewed-on: https://go-review.googlesource.com/50550
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>