pike.git / src / program.c

version» Context lines:

pike.git/src/program.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: program.c,v 1.595 2005/08/10 11:55:49 grubba Exp $ + || $Id: program.c,v 1.596 2005/11/01 10:16:08 grubba Exp $   */      #include "global.h"   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "lex.h"
pike.git/src/program.c:8215:    len = (((char *)(p->program + p->num_program)) - ((char *)addr) +    (PAGESIZE - 1)) & ~(PAGESIZE-1);      #ifdef _WIN32    {    DWORD old_prot;    VirtualProtect(addr, len, PAGE_EXECUTE_READWRITE, &old_prot);    }   #else /* _WIN32 */    +  + #if !defined(HAVE_MMAP) || !defined(MEXEC_USES_MMAP)    if (mprotect(addr, len, PROT_EXEC | PROT_READ | PROT_WRITE) < 0) {   #if 0    fprintf(stderr, "%p:%d: mprotect(%p, %lu, 0x%04x): errno: %d\n",    (void *)p->program,    (unsigned long)(p->num_program*sizeof(p->program[0])),    addr, len,    PROT_EXEC | PROT_READ | PROT_WRITE,    errno);   #endif /* 0 */    } -  + #endif /* !HAVE_MMAP || !MEXEC_USES_MMAP */      #endif /* _WIN32 */      #ifdef HAVE_SYNC_INSTRUCTION_MEMORY    sync_instruction_memory(p->program,    p->num_program*sizeof(p->program[0]));   #elif defined(FLUSH_INSTRUCTION_CACHE)    FLUSH_INSTRUCTION_CACHE(p->program,    p->num_program*sizeof(p->program[0]));   #endif /* HAVE_SYNC_INSTRUCTION_MEMORY || FLUSH_INSTRUCTION_CACHE */   }   #endif