]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4re-core/ldso/libdl/dl-syscall.h
Update
[l4.git] / l4 / pkg / l4re-core / ldso / libdl / dl-syscall.h
1 #pragma once
2
3 #include <sys/types.h>
4 #include <sys/stat.h>
5 #include <sys/mman.h>
6 #include <fcntl.h>
7 #include <errno.h>
8 #include <unistd.h>
9
10 static inline void
11 _dl_exit(int status) { exit(status); }
12
13 static inline int
14 _dl_mprotect(void *addr, size_t len, int prot)
15 { (void)addr; (void)len; (void)prot; return -1; } //mprotect(addr, len, prot); }
16
17 static inline int
18 _dl_stat(const char *path, struct stat * buf)
19 { return stat(path, buf); }
20
21 static inline int
22 _dl_fstat(int fd, struct stat *buf)
23 { return fstat(fd, buf); }
24
25 static inline int
26 _dl_getuid(void)
27 { return 0; }
28
29  static inline int
30 _dl_geteuid(void)
31 { return 0; }
32
33 static inline int
34 _dl_getgid(void)
35 { return 0; }
36
37 static inline int
38 _dl_getegid(void)
39 { return 0; }
40
41
42
43 static inline int
44 _dl_munmap(void *start, size_t len)
45 { return munmap(start, len); }
46
47 static inline int
48 _dl_mmap_check_error(void *x)
49 { return x == MAP_FAILED; }
50
51 extern int open (const char *__file, int __oflag, ...) __nonnull ((1));
52
53 static inline int
54 _dl_open(char const *path, int flags, int mode)
55 { return open(path, flags, mode); }
56
57 static inline int
58 _dl_close(int fd)
59 { return close(fd); }
60
61 static inline int
62 _dl_read(int fd, void *buf, size_t len)
63 { return read(fd, buf, len); }
64
65 static inline int
66 _dl_write(int fd, char const *str, size_t len)
67 { (void)fd; (void)str; (void)len; return -1; }
68
69 static inline int
70 _dl_getpid(void)
71 { return 10; }
72
73 static inline int
74 _dl_cap_equal(unsigned long a, unsigned long b)
75 {
76   (void)a;
77   (void)b;
78   return 0;
79 }
80
81
82 static inline void *
83 _dl_mmap(void *start, size_t len, int prot, int flags, int fd, off_t offset)
84 { return mmap(start, len, prot, flags, fd, offset); }
85 #ifdef SHARED
86 #define _dl_errno errno
87 #else
88 extern int _dl_errno;
89 #endif