Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/http/worker.cfa

    rd9c2284 r03ed863  
    1212#include "filecache.hfa"
    1313
     14extern "C" {
     15// extern ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
     16extern ssize_t splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags);
     17}
     18
     19ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) {
     20        return splice(in_fd, offset, out_fd, 0p, count, 0);
     21}
     22
     23
    1424//=============================================================================================
    1525// Worker Thread
     
    1727void ?{}( Worker & this ) {
    1828        ((thread&)this){ "Server Worker Thread", *options.clopts.instance };
    19         this.pipe[0] = -1;
    20         this.pipe[1] = -1;
     29        int ret = pipe(this.pipe);
     30        if( ret < 0 ) { abort( "pipe error: (%d) %s\n", (int)errno, strerror(errno) ); }
    2131}
    2232
    2333void main( Worker & this ) {
    24         park( __cfaabi_dbg_ctx );
    25         /* paranoid */ assert( this.pipe[0] != -1 );
    26         /* paranoid */ assert( this.pipe[1] != -1 );
    27 
    2834        CONNECTION:
    2935        for() {
Note: See TracChangeset for help on using the changeset viewer.