From 15694b30327937a1a0a4af608472197cb24567da Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 4 Nov 2005 14:48:35 +0000 Subject: [PATCH] Will take over the functionality of HaikuBuildCompatiblity.h, while that one will make a BeOS platform more Haiku compatible. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14692 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/build/BeOSBuildCompatibility.h | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 headers/build/BeOSBuildCompatibility.h diff --git a/headers/build/BeOSBuildCompatibility.h b/headers/build/BeOSBuildCompatibility.h new file mode 100644 index 0000000000..eec6454192 --- /dev/null +++ b/headers/build/BeOSBuildCompatibility.h @@ -0,0 +1,55 @@ +#ifndef HAIKU_BUILD_COMPATIBILITY_H +#define HAIKU_BUILD_COMPATIBILITY_H + +typedef unsigned long haiku_build_addr_t; +#define addr_t haiku_build_addr_t + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// Is kernel-only under Linux. +extern size_t strlcpy(char *dest, const char *source, size_t length); + +// BeOS only +extern ssize_t read_pos(int fd, off_t pos, void *buffer, size_t count); +extern ssize_t write_pos(int fd, off_t pos, const void *buffer,size_t count); + + +// There's no O_NOTRAVERSE under Linux, but there's a O_NOFOLLOW, which +// means something different (open() fails when the file is a symlink), but +// we can abuse this flag for our purposes (we filter it in libroot). +#ifndef O_NOTRAVERSE + #ifdef O_NOFOLLOW + #define O_NOTRAVERSE O_NOFOLLOW + #else + #define O_NOTRAVERSE 0 + #endif +#endif + +#ifndef S_IUMSK + #define S_IUMSK ALLPERMS +#endif + + +// remap strerror() +extern char *_haiku_build_strerror(int errnum); + +#ifndef BUILDING_HAIKU_ERROR_MAPPER + +#undef strerror +#define strerror(errnum) _haiku_build_strerror(errnum) + +#endif + + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // HAIKU_BUILD_COMPATIBILITY_H +