pike.git / src / modules / Pipe / pipe.c

version» Context lines:

pike.git/src/modules/Pipe/pipe.c:753: Inside #if defined(HAVE_MMAP) && defined(HAVE_MUNMAP)
      apply(obj, "query_fd", 0);    if(TYPEOF(sp[-1]) == T_INT) fd=sp[-1].u.integer;    pop_stack();       if (fd != -1 && fstat(fd,&s)==0)    {    off_t filep=fd_lseek(fd, 0L, SEEK_CUR); /* keep the file pointer */    size_t len = s.st_size - filep;    if(S_ISREG(s.st_mode) /* regular file */ +  && (filep >= 0) /* lseek() succeeded. */    && ((m=(char *)mmap(0, len, PROT_READ,    MAP_FILE|MAP_SHARED,fd,filep))+1))    {    mmapped += len;       i->type=I_MMAP;    i->len = len;    i->u.mmap=m;   #if defined(HAVE_MADVISE) && defined(MADV_SEQUENTIAL)    /* Mark the pages as sequential read only access... */