2 * avoid conflicts between our __unused define and the ones that might come in
7 #ifdef HOST_LONG_ALIGNED
11 #define timeval sys_timeval
14 #include <sys/types.h>
22 #define INVALID_HANDLE_VALUE -1
24 /* Android is not a true Linux ;-) */
25 #ifdef HOST_OS_android
30 #define LIBC_NAME "libc.so.6"
35 #define LIBC_NAME "libSystem.dylib"
36 #define DISK_DEVICE "/dev/disk%ld"
41 #define LIBC_NAME "libc.so"
45 #define DISK_DEVICE "/dev/hd%lc"
49 /* AROS includes don't define struct stat64, this shuts up warning when compiling host-independent part */
54 int (*open
)(char *path
, int oflag
, ...);
55 int (*close
)(int filedes
);
56 ssize_t (*read
)(int fildes
, void *buf
, size_t nbyte
);
57 ssize_t (*write
)(int fildes
, const void *buf
, size_t nbyte
);
58 int (*ioctl
)(int d
, int request
, ...);
59 #ifdef HOST_LONG_ALIGNED
60 off_t (*lseek
)(int fildes
, unsigned long offset_l
, unsigned long offset_h
, int whence
);
62 off_t (*lseek
)(int fildes
, off_t offset
, int whence
);
64 int *(*__error
)(void);
66 int (*__fxstat64
)(int ver
, int fd
, struct stat64
*buf
);
67 #define fstat64(fd, buf) __fxstat64(_STAT_VER, fd, buf)
69 int (*fstat64
)(int fd
, struct stat64
*buf
);
71 int (*stat64
)(const char *path
, struct stat64
*buf
);
74 #ifdef HOST_LONG_ALIGNED
76 * Somewhat dirty hack to adjust data packing to iOS ARM ABI.
77 * Perhaps this can be done in a cleaner and more CPU-abstract way.
78 * FIXME: Always assuming little-endian CPU
80 #define LSeek(fildes, offset, offset_high, whence) hdskBase->iface->lseek(fildes, offset, offset_high, whence)
82 #define LSeek(fildes, offset, offset_high, whence) hdskBase->iface->lseek(fildes, (UQUAD)offset | (UQUAD)offset_high << 32, whence)
87 /* This routine is specific to a particular UNIX variant */
88 ULONG
Host_DeviceGeometry(int file
, struct DriveGeometry
*dg
, struct HostDiskBase
*hdskBase
);