]> gitweb.factorcode.org Git - factor.git/blob - vm/os-unix.hpp
vm: interrupt stdin_loop when entering fep
[factor.git] / vm / os-unix.hpp
1 #include <unistd.h>
2 #include <sys/param.h>
3 #include <dirent.h>
4 #include <sys/mman.h>
5 #include <sys/types.h>
6 #include <sys/stat.h>
7 #include <unistd.h>
8 #include <sys/time.h>
9 #include <dlfcn.h>
10 #include <signal.h>
11 #include <pthread.h>
12 #include <sched.h>
13
14 #include "atomic-gcc.hpp"
15
16 namespace factor
17 {
18
19 typedef char vm_char;
20 typedef char symbol_char;
21
22 #define STRING_LITERAL(string) string
23
24 #define SSCANF sscanf
25 #define STRCMP strcmp
26 #define STRNCMP strncmp
27 #define STRDUP strdup
28 #define SNPRINTF snprintf
29
30 #define FTELL ftello
31 #define FSEEK fseeko
32
33 #define OPEN_READ(path) fopen(path,"rb")
34 #define OPEN_WRITE(path) fopen(path,"wb")
35
36 #define print_native_string(string) print_string(string)
37
38 typedef pthread_t THREADHANDLE;
39
40 THREADHANDLE start_thread(void *(*start_routine)(void *),void *args);
41 inline static THREADHANDLE thread_id() { return pthread_self(); }
42
43 u64 nano_count();
44 void sleep_nanos(u64 nsec);
45
46 void move_file(const vm_char *path1, const vm_char *path2);
47
48 }