Changeset 11954 in project


Ignore:
Timestamp:
09/15/08 20:33:44 (13 years ago)
Author:
certainty
Message:

prepare c-impl so that we can distinguish errors from waits
so that we can pass control to other threads.

Location:
release/4/sendfile/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/sendfile/trunk/sendfile-implementation.c

    r11950 r11954  
    3535  res = sendfile(dst,src,&curoffset,to_send);
    3636 
    37   if(res == -1 && (errno != EAGAIN &&  errno != EINTR))
    38     return -1;
    39  
     37        if(res < 0){
     38                if(errno == EAGAIN || errno == EINTR)
     39                         return -2;
     40                return -1;
     41        } 
    4042 
    4143#ifdef HAVE_POSIX_FADVISE
     
    6163
    6264  if(sendfile(src,dst,offset,to_send,NULL,&res,0) < 0){
    63     if(errno != EAGAIN)
    64       return -1;
     65    if(errno == EAGAIN)
     66                        return -2;
     67                return -1;
    6568  }
    6669
     
    8386  //memset(&hdtr,0,sizeof(hdtr));
    8487  if(sendfile(src,dst,(off_t)offset,&res,NULL/*&hdtr*/,0) < 0){
    85     if(errno != EAGAIN)
    86       return -1;
     88    if(errno == EAGAIN)
     89                        return -2;
     90                return -1;
    8791  }
    8892
     
    102106   
    103107  if(sendfilev(dst,&fvec,1,&written) == -1){
    104     if(errno != EAGAIN)
    105       return -1;
     108    if(errno == EAGAIN)
     109                        return -2;
     110                return -1;
    106111  }
    107112
  • release/4/sendfile/trunk/sendfile.scm

    r11952 r11954  
    252252                 (new-offset (%sendfile-implementation src dst offset next-chunk)))
    253253            (cond
     254             ;;TODO yield control to other threads if new-offset is -2
    254255             ((negative? new-offset)
    255256              (##sys#update-errno)
Note: See TracChangeset for help on using the changeset viewer.