3 #include <l4/sys/ipc.h>
4 #include <l4/sys/kdebug.h>
5 #include <l4/sys/err.h>
6 #include <l4/sys/task.h>
7 #include <l4/re/consts.h>
8 #include <l4/re/elf_aux.h>
11 #include <sys/fcntl.h>
15 extern attribute_hidden void *__rtld_l4re_env_posix_vfs_ops;
16 #define L4RE_VFS ((l4re_posix_vfs_ops_t *)__rtld_l4re_env_posix_vfs_ops)
18 #define L4RE_CALL(call...) \
23 { (void)status; while(1) ;/*l4_ipc_sleep(L4_IPC_NEVER);*/ }
26 _dl_mmap_check_error(void *x)
27 { return x == MAP_FAILED; }
29 L4RE_CALL(int _dl_mprotect(void const *addr, size_t len, int prot));
30 L4RE_CALL(int _dl_stat(const char *path, struct stat * buf));
31 L4RE_CALL(int _dl_fstat(int fd, struct stat *buf));
32 L4RE_CALL(int _dl_munmap(void *start, size_t len));
33 L4RE_CALL(int _dl_open(char const *path, int flags, int mode));
34 L4RE_CALL(int _dl_close(int fd));
35 L4RE_CALL(int _dl_read(int fd, void *buf, size_t len));
36 L4RE_CALL(int _dl_write(int fd, char const *str, size_t len));
37 L4RE_CALL(void *_dl_mmap(void *start, size_t len, int prot, int flags, int fd, off_t offset));
41 _dl_cap_equal(unsigned long a, unsigned long b)
43 l4_msgtag_t t = l4_task_cap_equal_u(L4RE_THIS_TASK_CAP, a, b, l4_utcb_direct());
44 return l4_msgtag_label(t);