Follow CL 63090 and change the Makedev function on Darwin and *BSD to
convert to uint64 before shifting/masking. This avoids a potential
overflow.
Change-Id: I5b566329695cc5edcf82f0ff2366033011b0625b
Reviewed-on: https://go-review.googlesource.com/63112
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 the macros defined in Darwin's
sys/types.h header. However, the parameter and return types are changed
to match the respective Linux implementation of these functions.
Test the conversion macros with some well-known static device numbers
for devices which should be present on any Darwin system.
Updates golang/go#8106
Change-Id: I1862be64684cc1b5a53e15a883819571e368cb2b
Reviewed-on: https://go-review.googlesource.com/60610
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>