7fd42181 |
1 | #include <stdio.h> |
2 | #include <stdlib.h> |
3 | #include <sys/types.h> |
4 | #include <sys/stat.h> |
5 | #include <fcntl.h> |
6 | #include <sys/mman.h> |
7 | #include <unistd.h> |
8 | #include <sys/ioctl.h> |
9 | #include <signal.h> |
10 | #include <termios.h> |
11 | |
12 | |
4d045184 |
13 | int real_open(const char *pathname, int flags, ...); |
7fd42181 |
14 | FILE *real_fopen(const char *path, const char *mode); |
15 | void *real_mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); |
16 | int real_read(int fd, void *buf, size_t count); |
17 | int real_ioctl(int fd, int request, void *argp); |
18 | int real_sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); |
19 | typedef struct sigaction sigaction_t; |
20 | int real_tcgetattr(int fd, struct termios *termios_p); |
21 | int real_tcsetattr(int fd, int optional_actions, const struct termios *termios_p); |
22 | int real_system(const char *command); |
23 | |
24 | #define open real_open |
25 | #define fopen real_fopen |
26 | #define mmap real_mmap |
27 | #define read real_read |
28 | #define ioctl real_ioctl |
29 | #define sigaction real_sigaction |
30 | #define tcgetattr real_tcgetattr |
31 | #define tcsetattr real_tcsetattr |
32 | #define system real_system |
33 | |