• Tobias Klauser's avatar
    unix: add Major, Minor and Mkdev functions on Darwin · a07a691a
    Tobias Klauser authored
    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/60610Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    a07a691a
dev_darwin.go 739 Bytes