pike.git / src / modules / _Stdio / sendfile.c

version» Context lines:

pike.git/src/modules/_Stdio/sendfile.c:562: Inside #if defined(HAVE_SENDFILE) && !defined(HAVE_FREEBSD_SENDFILE) && !defined(HAVE_HPUX_SENDFILE) && !defined(HAVE_MACOSX_SENDFILE)
   "sendfile: Sending file with sendfile() Linux & Solaris.\n"));    {    int fail;    off_t offset = this->offset;    if (this->len < 0) {    PIKE_STAT_T st;    if (!fd_fstat(this->from_fd, &st) &&    S_ISREG(st.st_mode)) {    this->len = st.st_size - offset; /* To end of file */    } else { -  this->len = MAX_LONGEST; +  this->len = MAX_INT64;    }    }    while (this->len > 0) {    do {    fail = sendfile(this->to_fd, this->from_fd, &offset, this->len);    } while ((fail < 0) && (errno == EINTR));    this->offset = offset;       if (fail <= 0) {    if (!fail) break; /* EOF */
pike.git/src/modules/_Stdio/sendfile.c:873:    *! Add a call to @[signal()] to avoid this.    *!    *! @seealso    *! @[Stdio.sendfile()]    */   static void sf_create(INT32 args)   {    struct pike_sendfile sf;    int iovcnt = 0;    struct svalue *cb = NULL; -  LONGEST offset, len; +  INT64 offset, len;       if (THIS->to_file) {    Pike_error("sendfile->create(): Called a second time!\n");    }       /* In case the user has succeeded in initializing _callback    * before create() is called.    */    free_svalue(&(THIS->callback));    SET_SVAL(THIS->callback, T_INT, NUMBER_NUMBER, integer, 0);