The
getdevmajor() function may fail and set
errno for any of the errors specified for the library functions
malloc(3) and
sysctlbyname(3). In addition, the following errors may be reported:
[EINVAL]
The value of the type argument is not S_IFCHR or S_IFBLK.
[ENOENT]
The named device is not found.