Works for me.
Code:
#define _BSD_SOURCE
#include <stdio.h>
#include <sys/types.h>
int main()
{
dev_t foo = makedev(10, 10);
printf("Major: %d\nMinor: %d\n", major(foo), minor(foo));
return 0;
}
By the way, there's a typo in the manpage for makedev, major and minor. The words "#include" and "#define" are swapped. Maybe the man-pages package maintainer could report it upstream if it's not fixed yet.
Edit: It's present in upstream, verified at:
http://www.kernel.org/doc/man-pages/...makedev.3.html
I'll email Michael Kerrisk myself.