This source file includes following definitions.
- _real_close
- _real_fstat
- _real_getdents
- _real_lseek
- _real_mkdir
- _real_mmap
- _real_munmap
- _real_open
- _real_open_resource
- _real_read
- _real_rmdir
- _real_write
- kernel_wrap_init
- kernel_wrap_uninit
#if defined(WIN32) || (defined(__linux__) && !defined(__native_client__))
#include <errno.h>
#include "nacl_io/kernel_wrap.h"
#include "nacl_io/kernel_wrap_real.h"
int _real_close(int fd) {
return ENOSYS;
}
int _real_fstat(int fd, struct stat *buf) {
return 0;
}
int _real_getdents(int fd, void* nacl_buf, size_t nacl_count, size_t *nread) {
return ENOSYS;
}
int _real_lseek(int fd, off_t offset, int whence, off_t* new_offset) {
return ENOSYS;
}
int _real_mkdir(const char* pathname, mode_t mode) {
return ENOSYS;
}
int _real_mmap(void** addr, size_t length, int prot, int flags, int fd,
off_t offset) {
return ENOSYS;
}
int _real_munmap(void* addr, size_t length) {
return ENOSYS;
}
int _real_open(const char* pathname, int oflag, mode_t cmode, int* newfd) {
return ENOSYS;
}
int _real_open_resource(const char* file, int* fd) {
return ENOSYS;
}
int _real_read(int fd, void *buf, size_t count, size_t *nread) {
*nread = count;
return 0;
}
int _real_rmdir(const char* pathname) {
return ENOSYS;
}
int _real_write(int fd, const void *buf, size_t count, size_t *nwrote) {
int rtn = write(fd, buf, count);
if (rtn < 0)
return -1;
*nwrote = rtn;
return 0;
}
#endif
#if defined(__linux__) && !defined(__native_client__)
void kernel_wrap_init() {
}
void kernel_wrap_uninit() {
}
#endif