newlib-gaspardos/gaspardos/x64/transport.h¶
Newlib OS backend or x64 transport. Build syscalls.c with GASPARDOS_NEWLIB_X64 for the LP64 target. Preserve the repository layout and include the native wrapper headers; these are not host or i686 build instructions.
Source files · Download transport.h
#ifndef GASPARDOS_NEWLIB_X64_TRANSPORT_H
#define GASPARDOS_NEWLIB_X64_TRANSPORT_H
#include "../../../bindings/native/gaspardos_x64_syscall.h"
#define GO_FSInfo GO64_FSInfo
#define GO_FS_Open GO64_fs_open
#define GO_FS_Close GO64_fs_close
#define GO_FS_Read GO64_fs_read
#define GO_FS_Write GO64_fs_write
#define GO_FS_Seek GO64_fs_seek
#define GO_FS_Stat GO64_fs_stat
#define GO_FS_FStat GO64_fs_fstat
#define GO_FS_Mkdir GO64_fs_mkdir
#define GO_FS_Unlink GO64_fs_unlink
#define GO_FS_Rmdir GO64_fs_rmdir
#define GO_FS_Rename GO64_fs_rename
#define GO_FS_Fcntl GO64_fs_fcntl
#define GO_O_CREAT GO64_CREAT
#define GO_O_EXCL GO64_EXCL
#define GO_O_TRUNC GO64_TRUNC
#define GO_O_APPEND GO64_APPEND
#define GO_O_ACCMODE 3
/* Native Linux-style errors translated by the common backend to newlib. */
#define GO_ENAMETOOLONG 36
#define GO_ENOSYS 38
#define GO_ENOTEMPTY 39
#define GO_EPROTONOSUPPORT 93
#define GO_ESOCKTNOSUPPORT 94
#define GO_EAFNOSUPPORT 97
#define GO_EADDRINUSE 98
#define GO_ENETRESET 102
#define GO_ENOTCONN 107
static inline void *GO_Alloc(size_t size) {
int64_t r = GO64_alloc(size);
return r < 0 ? NULL : (void *)(uintptr_t)r;
}
static inline void GO_PrintChar(unsigned char c) { (void)GO64_console_write(&c,1); }
#define GO_Exit GO64_exit
#endif