Mercurial > hg > Game > Cerium
view example/word_count/ppe/Read.cc @ 2048:6796d85f3d6b draft
remove error
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 28 Jan 2016 00:05:49 +0900 |
parents | 8fbe022126e1 |
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 "Print.h" #include "Func.h" #include "WordCount.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; }