xref: /haiku/headers/build/BeOSBuildCompatibility.h (revision 64c51217b2f66a39b16df84f5f358df10f7fc179)
1 #ifndef BEOS_BUILD_COMPATIBILITY_H
2 #define BEOS_BUILD_COMPATIBILITY_H
3 
4 typedef unsigned long haiku_build_addr_t;
5 #define addr_t haiku_build_addr_t
6 
7 #include <Errors.h>
8 #include <sys/types.h>
9 #include <string.h>
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 // Is kernel-only under Linux.
16 extern size_t   strlcpy(char *dest, const char *source, size_t length);
17 
18 // BeOS only
19 extern ssize_t  read_pos(int fd, off_t pos, void *buffer, size_t count);
20 extern ssize_t  write_pos(int fd, off_t pos, const void *buffer,size_t count);
21 
22 
23 // There's no O_NOTRAVERSE under Linux, but there's a O_NOFOLLOW, which
24 // means something different (open() fails when the file is a symlink), but
25 // we can abuse this flag for our purposes (we filter it in libroot).
26 #ifndef O_NOTRAVERSE
27         #ifdef O_NOFOLLOW
28                 #define O_NOTRAVERSE O_NOFOLLOW
29         #else
30                 #define O_NOTRAVERSE 0
31         #endif
32 #endif
33 
34 #ifndef S_IUMSK
35 	#define S_IUMSK ALLPERMS
36 #endif
37 
38 
39 // remap strerror()
40 extern char *_haiku_build_strerror(int errnum);
41 
42 #ifndef BUILDING_HAIKU_ERROR_MAPPER
43 
44 #undef strerror
45 #define strerror(errnum)	_haiku_build_strerror(errnum)
46 
47 #endif
48 
49 
50 #ifdef __cplusplus
51 } // extern "C"
52 #endif
53 
54 #endif	// BEOS_BUILD_COMPATIBILITY_H
55 
56