factor/vm/os-unix.hpp

47 lines
944 B
C++
Raw Normal View History

2009-05-13 02:08:16 -04:00
#include <unistd.h>
#include <sys/param.h>
2009-05-02 05:04:19 -04:00
#include <dirent.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/time.h>
#include <dlfcn.h>
#include <signal.h>
#include <pthread.h>
2009-05-04 02:46:13 -04:00
namespace factor
{
2009-05-04 05:50:24 -04:00
typedef char vm_char;
typedef char symbol_char;
2009-05-02 05:04:19 -04:00
#define STRING_LITERAL(string) string
#define SSCANF sscanf
#define STRCMP strcmp
#define STRNCMP strncmp
#define STRDUP strdup
#define SNPRINTF snprintf
2009-05-02 05:04:19 -04:00
2009-10-03 19:20:35 -04:00
#define FTELL ftello
2009-05-02 05:04:19 -04:00
#define FSEEK fseeko
#define OPEN_READ(path) fopen(path,"rb")
#define OPEN_WRITE(path) fopen(path,"wb")
#define print_native_string(string) print_string(string)
2009-05-02 05:04:19 -04:00
2009-08-25 03:55:18 -04:00
typedef pthread_t THREADHANDLE;
2009-05-02 05:04:19 -04:00
2009-08-25 03:55:18 -04:00
THREADHANDLE start_thread(void *(*start_routine)(void *),void *args);
inline static THREADHANDLE thread_id() { return pthread_self(); }
2009-05-02 05:04:19 -04:00
u64 nano_count();
void sleep_nanos(u64 nsec);
2009-05-05 12:33:35 -04:00
void open_console();
void move_file(const vm_char *path1, const vm_char *path2);
2009-05-04 02:46:13 -04:00
}