Mercurial > hg > Game > Cerium
view TaskManager/kernel/sys_task/Read.cc @ 2069:26aa08c9a1de draft default tip
cuda example fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 12 Feb 2017 10:04:55 +0900 |
parents | b79a250b4f99 |
children |
line wrap: on
line source
#include <stdio.h> #include <string.h> #include <unistd.h> #include <sys/stat.h> #include <iostream> #include <vector> #include <cstdlib> #include "SchedTask.h" #include "SysFunc.h" /* これは必須 */ SchedDefineTask1(READ_TASK,read_task); static int read_task(SchedTask *s, void *rbuf, void *wbuf) { long fd = (long)s->get_param(0); long start_read_position = (long)s->get_param(1); long end_read_position = (long)s->get_param(2); char *read_text = (char*)s->get_output(wbuf,0); long read_size = end_read_position - start_read_position; pread(fd, read_text, read_size , start_read_position); return 0; }