llvm-project
e93e7a4f - [libc] Implement sys/sysmacros.h Linux header. (#216865)

Commit
4 days ago
[libc] Implement sys/sysmacros.h Linux header. (#216865) `<sys/sysmacros.h>` is a Linux header with routines for managing device number (construct device ID from major/minor IDs) - and contains functions `major`, `minor`, and `makedev`. Implement them as simple macro that redirect to the llvm-libc entrypoints with the same names. This would allow us to have more type safety (and explicitly specify argument/return types in our entrypoint implementation), and opens the door for defining those macro in a different way on other systems, wrapping the invocation of our implementation with type conversions, if needed (e.g. FreeBSD versions of these functions use "int" instead of "unsigned int" and are supposed to be provided by a different header - `<sys/types.h>`).
Author
Parents
Loading