Last active
August 29, 2015 14:17
-
-
Save good5dog5/3979a75836d9dc39e243 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fio.h line 15 | |
#define MAX_FDS 32 | |
typedef ssize_t (*fdread_t)(void * opaque, void * buf, size_t count); | |
typedef ssize_t (*fdwrite_t)(void * opaque, const void * buf, size_t count); | |
typedef off_t (*fdseek_t)(void * opaque, off_t offset, int whence); | |
typedef int (*fdclose_t)(void * opaque); | |
struct fddef_t { | |
fdread_t fdread; | |
fdwrite_t fdwrite; | |
fdseek_t fdseek; | |
fdclose_t fdclose; | |
void * opaque; | |
}; | |
// fio.c line 11 | |
static struct fddef_t fio_fds[MAX_FDS]; | |
// fio.c line 74 | |
__attribute__((constructor)) void fio_init() { | |
memset(fio_fds, 0, sizeof(fio_fds)); | |
fio_fds[0].fdread = stdin_read; | |
fio_fds[1].fdwrite = stdout_write; | |
fio_fds[2].fdwrite = stdout_write; | |
fio_sem = xSemaphoreCreateMutex(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment