2009-02-05 21:28:18 +03:00
|
|
|
/** \file unixcompat.h
|
|
|
|
* \brief Header: collects differences between the various Unix
|
|
|
|
*
|
|
|
|
* This header file collects differences between the various Unix
|
|
|
|
* variants that are supported by the Midnight Commander and provides
|
|
|
|
* replacement routines if they are not natively available.
|
|
|
|
* The major/minor macros are not specified in SUSv3, so we can only hope
|
|
|
|
* they are provided by the operating system or emulate it.
|
2005-01-26 01:54:41 +03:00
|
|
|
*/
|
|
|
|
|
2009-02-05 21:28:18 +03:00
|
|
|
#ifndef MC_UNIXCOMPAT_H
|
|
|
|
#define MC_UNIXCOMPAT_H
|
2005-01-26 01:54:41 +03:00
|
|
|
|
2010-11-08 13:21:45 +03:00
|
|
|
#include <sys/types.h> /* BSD */
|
2013-11-24 09:39:16 +04:00
|
|
|
|
2015-04-05 09:04:35 +03:00
|
|
|
#ifdef MAJOR_IN_MKDEV
|
2013-11-24 09:39:16 +04:00
|
|
|
#include <sys/mkdev.h>
|
2015-04-05 09:04:35 +03:00
|
|
|
#elif defined MAJOR_IN_SYSMACROS
|
2013-11-24 09:39:16 +04:00
|
|
|
#include <sys/sysmacros.h>
|
2005-01-28 01:19:48 +03:00
|
|
|
#endif
|
2005-01-26 01:54:41 +03:00
|
|
|
|
2013-12-20 11:26:56 +04:00
|
|
|
#include <unistd.h>
|
|
|
|
|
2010-11-08 13:21:45 +03:00
|
|
|
/*** typedefs(not structures) and defined constants **********************************************/
|
|
|
|
|
2005-01-26 01:54:41 +03:00
|
|
|
#ifndef major
|
2010-11-08 13:21:45 +03:00
|
|
|
#warning major() is undefined. Device numbers will not be shown correctly.
|
|
|
|
#define major(devnum) (((devnum) >> 8) & 0xff)
|
2005-01-26 01:54:41 +03:00
|
|
|
#endif
|
2010-11-08 13:21:45 +03:00
|
|
|
|
2005-01-26 01:54:41 +03:00
|
|
|
#ifndef minor
|
2010-11-08 13:21:45 +03:00
|
|
|
#warning minor() is undefined. Device numbers will not be shown correctly.
|
|
|
|
#define minor(devnum) (((devnum) & 0xff))
|
2005-01-26 01:54:41 +03:00
|
|
|
#endif
|
2010-11-08 13:21:45 +03:00
|
|
|
|
2005-01-28 02:02:24 +03:00
|
|
|
#ifndef makedev
|
2010-11-08 13:21:45 +03:00
|
|
|
#warning makedev() is undefined. Device numbers will not be shown correctly.
|
|
|
|
#define makedev(major,minor) ((((major) & 0xff) << 8) | ((minor) & 0xff))
|
2005-01-28 02:02:24 +03:00
|
|
|
#endif
|
2005-01-26 01:54:41 +03:00
|
|
|
|
2013-12-20 11:26:56 +04:00
|
|
|
#ifndef STDIN_FILENO
|
|
|
|
#define STDIN_FILENO 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef STDOUT_FILENO
|
|
|
|
#define STDOUT_FILENO 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef STDERR_FILENO
|
|
|
|
#define STDERR_FILENO 2
|
|
|
|
#endif
|
|
|
|
|
2010-11-08 13:21:45 +03:00
|
|
|
/*** enums ***************************************************************************************/
|
|
|
|
|
|
|
|
/*** structures declarations (and typedefs of structures)*****************************************/
|
|
|
|
|
|
|
|
/*** global variables defined in .c file *********************************************************/
|
|
|
|
|
|
|
|
/*** declarations of public functions ************************************************************/
|
|
|
|
|
|
|
|
/*** inline functions ****************************************************************************/
|
|
|
|
|
2005-01-26 01:54:41 +03:00
|
|
|
#endif
|