[lsb-discuss] Inclusion of makedev() and related functions

Craig Scott craig.scott at csiro.au
Fri Dec 31 18:41:41 PST 2010

As additional info, there are two other macros which are relevant here:


Both seem to be present alongside the makedev() macro definition in headers that I've checked so far. Using makedev(), major() and minor() should mean that none of the gnu_dev_* functions would actually be needed in most cases, since the macros should be able to replace any instances where gnu_dev_* functions are used.

Also, on Fedora 14 and SLED 10/11 systems at least, the makedev(), major() and minor() macros seem to have fully inlinable implementations which don't require calling through to gnu_dev_makedev, etc. Thus, it would probably be possible to add just the three macros to the LSB with no additional library interfaces being necessary. Whether the gnu_dev_* interfaces should be added for completeness is perhaps a different discussion.

On Sat, 1 Jan 2011 12:11:52 pm Craig Scott wrote:
> Hi all. Has there been any recent discussion around including the makedev() macro and its associated functions in LSB? Specifically, here's the things I'm talking about:
> makedev(major,minor)   <-- defined as a macro in sys/stat.h
> gnu_dev_makedev
> gnu_dev_major
> gnu_dev_minor
> According to the LSB Navigator, all four of these are available in every linux distribution except for one, Debian 3.1r2 on x86. Since this particular Debian version is quite old, it would seem appropriate that the makedev macro and its three associated functions be included in the LSB.
> The motivating case for me is in building CMake (I'm working with the latest release, which is 2.8.3). CMake makes use of makedev() in its archive creation code, which appears to be a genuinely valid situation where makedev is a reasonable thing for user code to want to do, even if it may require sudo or something similar to actually make use of this particular feature of CMake. If I understand the CMake code correctly, then the typicaly user probably won't need the makedev functionality unless they try to create a package that has device nodes in it. That would be a small proportion of CMake users, but CMake requires this code feature for it to be buildable. Having makedev() in the LSB would address this situation with seemingly few drawbacks given the widespread support for it already.

Dr Craig Scott
Computational Software Engineering Team Leader, CSIRO (CMIS)
Melbourne, Australia

More information about the lsb-discuss mailing list