2 * \brief Header: collects differences between the various Unix
4 * This header file collects differences between the various Unix
5 * variants that are supported by the Midnight Commander and provides
6 * replacement routines if they are not natively available.
7 * The major/minor macros are not specified in SUSv3, so we can only hope
8 * they are provided by the operating system or emulate it.
11 #ifndef MC_UNIXCOMPAT_H
12 #define MC_UNIXCOMPAT_H
14 #include <sys/types.h> /* BSD */
17 #include <sys/mkdev.h>
18 #elif defined MAJOR_IN_SYSMACROS
19 #include <sys/sysmacros.h>
24 /*** typedefs(not structures) and defined constants **********************************************/
27 #warning major() is undefined. Device numbers will not be shown correctly.
28 #define major(devnum) (((devnum) >> 8) & 0xff)
32 #warning minor() is undefined. Device numbers will not be shown correctly.
33 #define minor(devnum) (((devnum) & 0xff))
37 #warning makedev() is undefined. Device numbers will not be shown correctly.
38 #define makedev(major,minor) ((((major) & 0xff) << 8) | ((minor) & 0xff))
42 #define STDIN_FILENO 0
46 #define STDOUT_FILENO 1
50 #define STDERR_FILENO 2
53 /*** enums ***************************************************************************************/
55 /*** structures declarations (and typedefs of structures)*****************************************/
57 /*** global variables defined in .c file *********************************************************/
59 /*** declarations of public functions ************************************************************/
61 /*** inline functions ****************************************************************************/