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

version» Context lines:

pike.git/src/modules/Pipe/pipe.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: pipe.c,v 1.52 2002/10/21 17:06:22 marcus Exp $ + || $Id: pipe.c,v 1.53 2003/01/04 13:42:46 grubba Exp $   */      #include "global.h"   #include "config.h"   #include "machine.h"   #include "module.h"      #include <sys/types.h>   #include <sys/stat.h>   
pike.git/src/modules/Pipe/pipe.c:31:   #endif   #endif   #endif      #ifdef HAVE_SYS_ID_H   #include <sys/id.h>   #endif /* HAVE_SYS_ID_H */      #include <fcntl.h>    - RCSID("$Id: pipe.c,v 1.52 2002/10/21 17:06:22 marcus Exp $"); + RCSID("$Id: pipe.c,v 1.53 2003/01/04 13:42:46 grubba Exp $");      #include "threads.h"   #include "stralloc.h"   #include "pike_macros.h"   #include "object.h"   #include "constants.h"   #include "interpret.h"   #include "svalue.h"   #include "pike_error.h"   #include "builtin_functions.h"
pike.git/src/modules/Pipe/pipe.c:721: Inside #if defined(HAVE_MMAP) && defined(HAVE_MUNMAP)
   struct stat s;       apply(obj, "query_fd", 0);    if(sp[-1].type == T_INT) fd=sp[-1].u.integer;    pop_stack();       if (fd != -1 && fstat(fd,&s)==0)    {    int filep=fd_lseek(fd, 0L, SEEK_CUR); /* keep the file pointer */    if(S_ISREG(s.st_mode) /* regular file */ -  && ((long)(m=(char *)mmap(0,s.st_size - filep,PROT_READ, -  MAP_FILE|MAP_SHARED,fd,filep))!=-1)) +  && ((m=(char *)mmap(0,s.st_size - filep,PROT_READ, +  MAP_FILE|MAP_SHARED,fd,filep))+1))    {   #ifdef HAVE_GETEUID    int ou = 0;   #endif    mmapped += s.st_size;       i->type=I_MMAP;    i->len=s.st_size;    i->u.mmap=m;   #if defined(HAVE_MADVISE) && defined(MADV_SEQUENTIAL)