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>
23 #include <time.h> /* AIX for tm */
28 /*** typedefs(not structures) and defined constants **********************************************/
31 #warning major() is undefined. Device numbers will not be shown correctly.
32 #define major(devnum) (((devnum) >> 8) & 0xff)
36 #warning minor() is undefined. Device numbers will not be shown correctly.
37 #define minor(devnum) (((devnum) & 0xff))
41 #warning makedev() is undefined. Device numbers will not be shown correctly.
42 #define makedev(major,minor) ((((major) & 0xff) << 8) | ((minor) & 0xff))
46 #define STDIN_FILENO 0
50 #define STDOUT_FILENO 1
54 #define STDERR_FILENO 2
57 /*** enums ***************************************************************************************/
59 /*** structures declarations (and typedefs of structures)*****************************************/
61 /*** global variables defined in .c file *********************************************************/
63 /*** declarations of public functions ************************************************************/
65 /*** inline functions ****************************************************************************/