2 Copyright © 1995-2015, The AROS Development Team. All rights reserved.
6 #ifdef HOST_LONG_ALIGNED
21 #include <sys/mount.h>
24 /* Android is not a true Linux ;-) */
25 #ifdef HOST_OS_android
33 int (*open
)(char *path
, int oflag
, ...);
34 int (*close
)(int filedes
);
35 int (*closedir
)(DIR *dirp
);
36 DIR *(*opendir
)(char *dirname
);
37 struct dirent
*(*readdir
)(DIR *dirp
);
38 void (*rewinddir
)(DIR *dirp
);
39 ssize_t (*read
)(int fildes
, void *buf
, size_t nbyte
);
40 ssize_t (*write
)(int fildes
, const void *buf
, size_t nbyte
);
41 #ifdef HOST_LONG_ALIGNED
42 off_t (*lseek
)(int fildes
, unsigned long offset_l
, unsigned long offset_h
, int whence
);
43 int (*ftruncate
)(int fildes
, unsigned long length_l
, unsigned long length_h
);
45 off_t (*lseek
)(int fildes
, off_t offset
, int whence
);
46 int (*ftruncate
)(int fildes
, off_t length
);
48 int (*mkdir
)(char *path
, mode_t mode
);
49 int (*rmdir
)(const char *path
);
50 int (*unlink
)(const char *path
);
51 int (*link
)(char *path1
, char *path2
);
52 int (*symlink
)(char *path1
, char *path2
);
53 ssize_t (*readlink
)(char *path
, char *buf
, size_t bufsize
);
54 int (*rename
)(char *old
, char *new);
55 int (*chmod
)(char *path
, mode_t mode
);
56 int (*isatty
)(int fildes
);
57 int (*statfs
)(char *path
, struct statfs
*buf
);
58 int (*utime
)(char *path
, const struct utimbuf
*times
);
59 struct tm
*(*localtime
)(const time_t *clock
);
60 time_t (*mktime
)(struct tm
*timeptr
);
61 char *(*getcwd
)(char *buf
, size_t size
);
62 char *(*getenv
)(const char *name
);
63 int (*poll
)(struct pollfd
*fds
, nfds_t nfds
, int timeout
);
65 int (*__xstat
)(int ver
, char *path
, struct stat
*buf
);
66 int (*__lxstat
)(int ver
, const char *path
, struct stat
*buf
);
67 int (*__fxstat
)(int ver
, const int fd
, struct stat
*buf
);
68 #define stat(path, buf) __xstat(_STAT_VER, path, buf)
69 #define lstat(path, buf) __lxstat(_STAT_VER, path, buf)
70 #define fstat(fd, buf) __fxstat(_STAT_VER, fd, buf)
72 int (*stat
)(char *path
, struct stat
*buf
);
73 int (*lstat
)(const char *path
, struct stat
*buf
);
74 int (*fstat
)(int fd
, struct stat
*buf
);
76 #ifndef HOST_OS_android
77 void (*seekdir
)(DIR *dirp
, long loc
);
78 long (*telldir
)(DIR *dirp
);
79 struct passwd
*(*getpwent
)(void);
80 void (*endpwent
)(void);
84 #ifdef HOST_LONG_ALIGNED
86 * Somewhat dirty hack to adjust data packing to iOS ARM ABI.
87 * Perhaps this can be done in a cleaner and more CPU-abstract way.
88 * FIXME: Always assuming little-endian CPU
90 #define LSeek(fildes, offset, whence) emulbase->pdata.SysIFace->lseek(fildes, (ULONG)offset, (ULONG)((UQUAD)offset >> 32), whence)
91 #define FTruncate(fildes, length) emulbase->pdata.SysIFace->ftruncate(fildes, (ULONG)length, (ULONG)((UQUAD)length >> 32))
93 #define LSeek(fildes, offset, whence) emulbase->pdata.SysIFace->lseek(fildes, offset, whence)
94 #define FTruncate(fildes, length) emulbase->pdata.SysIFace->ftruncate(fildes, length)