Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcvs2svn <>2006-03-21 03:57:35 +0300
committercvs2svn <>2006-03-21 03:57:35 +0300
commitf84325d0899e5052fd59892ece265f7c2bd6c6a7 (patch)
treefdbea2e5c834b2c023ecd6f1f15ea1474186a4e1 /winsup/cygwin/mmap.cc
parent3078fb4f360e44b436bafcd9e7c51f26792e34b4 (diff)
This commit was manufactured by cvs2svn to create branch 'newlib-newlib-csl-20060320-branchpoint
csl-20060320-branch'. Sprout from master 2006-03-21 00:57:34 UTC Mark Mitchell <mark@codesourcery.com> ' * acconfig.h (_ATEXIT_DYNAMIC_ALLOC): Undef.' Cherrypick from cygnus 1999-05-03 07:29:06 UTC Richard Henderson <rth@redhat.com> '19990502 sourceware import': README config/mh-armpic config/mh-elfalphapic config/mh-m68kpic config/mh-papic config/mh-ppcpic config/mh-x86pic config/mt-d30v config/mt-netware config/mt-ospace etc/add-log.el etc/add-log.vi etc/configbuild.ein etc/configbuild.fig etc/configbuild.jin etc/configbuild.tin etc/configdev.ein etc/configdev.fig etc/configdev.jin etc/configdev.tin etc/configure etc/configure.in makefile.vms Delete: compile djunpack.bat include/COPYING include/ChangeLog include/ChangeLog-9103 include/MAINTAINERS include/alloca-conf.h include/ansidecl.h include/aout/ChangeLog include/aout/adobe.h include/aout/aout64.h include/aout/ar.h include/aout/dynix3.h include/aout/encap.h include/aout/host.h include/aout/hp.h include/aout/hp300hpux.h include/aout/hppa.h include/aout/ranlib.h include/aout/reloc.h include/aout/stab.def include/aout/stab_gnu.h include/aout/sun4.h include/bfdlink.h include/bin-bugs.h include/bout.h include/coff/ChangeLog include/coff/ChangeLog-9103 include/coff/alpha.h include/coff/apollo.h include/coff/arm.h include/coff/aux-coff.h include/coff/ecoff.h include/coff/external.h include/coff/go32exe.h include/coff/h8300.h include/coff/h8500.h include/coff/i386.h include/coff/i860.h include/coff/i960.h include/coff/ia64.h include/coff/internal.h include/coff/m68k.h include/coff/m88k.h include/coff/maxq.h include/coff/mcore.h include/coff/mips.h include/coff/mipspe.h include/coff/or32.h include/coff/pe.h include/coff/powerpc.h include/coff/rs6000.h include/coff/rs6k64.h include/coff/sh.h include/coff/sparc.h include/coff/sym.h include/coff/symconst.h include/coff/ti.h include/coff/tic30.h include/coff/tic4x.h include/coff/tic54x.h include/coff/tic80.h include/coff/w65.h include/coff/we32k.h include/coff/xcoff.h include/coff/z80.h include/coff/z8k.h include/demangle.h include/dis-asm.h include/dyn-string.h include/elf/ChangeLog include/elf/ChangeLog-9103 include/elf/alpha.h include/elf/arc.h include/elf/arm.h include/elf/avr.h include/elf/bfin.h include/elf/common.h include/elf/cr16c.h include/elf/cris.h include/elf/crx.h include/elf/d10v.h include/elf/d30v.h include/elf/dlx.h include/elf/dwarf.h include/elf/dwarf2.h include/elf/external.h include/elf/fr30.h include/elf/frv.h include/elf/h8.h include/elf/hppa.h include/elf/i370.h include/elf/i386.h include/elf/i860.h include/elf/i960.h include/elf/ia64.h include/elf/internal.h include/elf/ip2k.h include/elf/iq2000.h include/elf/m32c.h include/elf/m32r.h include/elf/m68hc11.h include/elf/m68k.h include/elf/mcore.h include/elf/mips.h include/elf/mmix.h include/elf/mn10200.h include/elf/mn10300.h include/elf/msp430.h include/elf/mt.h include/elf/openrisc.h include/elf/or32.h include/elf/pj.h include/elf/ppc.h include/elf/ppc64.h include/elf/reloc-macros.h include/elf/s390.h include/elf/sh.h include/elf/sparc.h include/elf/v850.h include/elf/vax.h include/elf/x86-64.h include/elf/xc16x.h include/elf/xstormy16.h include/elf/xtensa.h include/fibheap.h include/filenames.h include/floatformat.h include/fnmatch.h include/fopen-bin.h include/fopen-same.h include/fopen-vms.h include/gdb/ChangeLog include/gdb/callback.h include/gdb/fileio.h include/gdb/remote-sim.h include/gdb/signals.h include/gdb/sim-arm.h include/gdb/sim-d10v.h include/gdb/sim-frv.h include/gdb/sim-h8300.h include/gdb/sim-m32c.h include/gdb/sim-ppc.h include/gdb/sim-sh.h include/gdbm.h include/getopt.h include/hashtab.h include/hp-symtab.h include/ieee.h include/libiberty.h include/md5.h include/nlm/ChangeLog include/nlm/alpha-ext.h include/nlm/common.h include/nlm/external.h include/nlm/i386-ext.h include/nlm/internal.h include/nlm/ppc-ext.h include/nlm/sparc32-ext.h include/oasys.h include/objalloc.h include/obstack.h include/opcode/ChangeLog include/opcode/ChangeLog-9103 include/opcode/alpha.h include/opcode/arc.h include/opcode/arm.h include/opcode/avr.h include/opcode/bfin.h include/opcode/cgen-bitset.h include/opcode/cgen.h include/opcode/convex.h include/opcode/cris.h include/opcode/crx.h include/opcode/d10v.h include/opcode/d30v.h include/opcode/dlx.h include/opcode/h8300.h include/opcode/hppa.h include/opcode/i370.h include/opcode/i386.h include/opcode/i860.h include/opcode/i960.h include/opcode/ia64.h include/opcode/m68hc11.h include/opcode/m68k.h include/opcode/m88k.h include/opcode/maxq.h include/opcode/mips.h include/opcode/mmix.h include/opcode/mn10200.h include/opcode/mn10300.h include/opcode/msp430.h include/opcode/np1.h include/opcode/ns32k.h include/opcode/or32.h include/opcode/pdp11.h include/opcode/pj.h include/opcode/pn.h include/opcode/ppc.h include/opcode/pyr.h include/opcode/s390.h include/opcode/sparc.h include/opcode/tahoe.h include/opcode/tic30.h include/opcode/tic4x.h include/opcode/tic54x.h include/opcode/tic80.h include/opcode/v850.h include/opcode/vax.h include/os9k.h include/partition.h include/progress.h include/safe-ctype.h include/sort.h include/splay-tree.h include/symcat.h include/ternary.h include/xregex.h include/xregex2.h include/xtensa-config.h include/xtensa-isa-internal.h include/xtensa-isa.h winsup/COPYING winsup/CYGWIN_LICENSE winsup/ChangeLog winsup/Makefile.common winsup/Makefile.in winsup/README winsup/configure winsup/configure.in winsup/cygserver/ChangeLog winsup/cygserver/Makefile.in winsup/cygserver/README winsup/cygserver/bsd_helper.cc winsup/cygserver/bsd_helper.h winsup/cygserver/bsd_log.cc winsup/cygserver/bsd_log.h winsup/cygserver/bsd_mutex.cc winsup/cygserver/bsd_mutex.h winsup/cygserver/client.cc winsup/cygserver/configure winsup/cygserver/configure.in winsup/cygserver/cygserver-config winsup/cygserver/cygserver.cc winsup/cygserver/cygserver.conf winsup/cygserver/msg.cc winsup/cygserver/process.cc winsup/cygserver/process.h winsup/cygserver/sem.cc winsup/cygserver/shm.cc winsup/cygserver/sysv_msg.cc winsup/cygserver/sysv_sem.cc winsup/cygserver/sysv_shm.cc winsup/cygserver/threaded_queue.cc winsup/cygserver/threaded_queue.h winsup/cygserver/transport.cc winsup/cygserver/transport.h winsup/cygserver/transport_pipes.cc winsup/cygserver/transport_pipes.h winsup/cygserver/transport_sockets.cc winsup/cygserver/transport_sockets.h winsup/cygserver/wincap.cc winsup/cygserver/wincap.h winsup/cygserver/woutsup.h winsup/cygwin/CYGWIN_LICENSE winsup/cygwin/ChangeLog winsup/cygwin/ChangeLog-1995 winsup/cygwin/ChangeLog-1996 winsup/cygwin/ChangeLog-1997 winsup/cygwin/ChangeLog-1998 winsup/cygwin/ChangeLog-1999 winsup/cygwin/ChangeLog-2000 winsup/cygwin/ChangeLog-2001 winsup/cygwin/ChangeLog-2002 winsup/cygwin/ChangeLog-2003 winsup/cygwin/ChangeLog-2004 winsup/cygwin/ChangeLog-2005 winsup/cygwin/Makefile.in winsup/cygwin/ROADMAP winsup/cygwin/acconfig.h winsup/cygwin/analyze_sigfe winsup/cygwin/ansi.sgml winsup/cygwin/assert.cc winsup/cygwin/autoload.cc winsup/cygwin/automode.c winsup/cygwin/binmode.c winsup/cygwin/child_info.h winsup/cygwin/config.h.in winsup/cygwin/config/i386/profile.h winsup/cygwin/configure winsup/cygwin/configure.in winsup/cygwin/cpuid.h winsup/cygwin/crt0.c winsup/cygwin/ctype.cc winsup/cygwin/cxx.cc winsup/cygwin/cygerrno.h winsup/cygwin/cygheap.cc winsup/cygwin/cygheap.h winsup/cygwin/cygmagic winsup/cygwin/cygmalloc.h winsup/cygwin/cygserver.h winsup/cygwin/cygserver_ipc.h winsup/cygwin/cygserver_msg.h winsup/cygwin/cygserver_sem.h winsup/cygwin/cygserver_shm.h winsup/cygwin/cygthread.cc winsup/cygwin/cygthread.h winsup/cygwin/cygtls.cc winsup/cygwin/cygtls.h winsup/cygwin/cygwin-shilka winsup/cygwin/cygwin.din winsup/cygwin/cygwin.sc winsup/cygwin/cygwin_version.h winsup/cygwin/dcrt0.cc winsup/cygwin/debug.cc winsup/cygwin/debug.h winsup/cygwin/delqueue.cc winsup/cygwin/devices.cc winsup/cygwin/devices.h winsup/cygwin/devices.in winsup/cygwin/dir.cc winsup/cygwin/dlfcn.cc winsup/cygwin/dll_init.cc winsup/cygwin/dll_init.h winsup/cygwin/dll_init.sgml winsup/cygwin/dllfixdbg winsup/cygwin/dlmalloc.c winsup/cygwin/dlmalloc.h winsup/cygwin/dtable.cc winsup/cygwin/dtable.h winsup/cygwin/dtable.sgml winsup/cygwin/environ.cc winsup/cygwin/environ.h winsup/cygwin/errno.cc winsup/cygwin/exceptions.cc winsup/cygwin/exec.cc winsup/cygwin/external.cc winsup/cygwin/external.sgml winsup/cygwin/fcntl.cc winsup/cygwin/fhandler.cc winsup/cygwin/fhandler.h winsup/cygwin/fhandler_clipboard.cc winsup/cygwin/fhandler_console.cc winsup/cygwin/fhandler_disk_file.cc winsup/cygwin/fhandler_dsp.cc winsup/cygwin/fhandler_fifo.cc winsup/cygwin/fhandler_floppy.cc winsup/cygwin/fhandler_mailslot.cc winsup/cygwin/fhandler_mem.cc winsup/cygwin/fhandler_netdrive.cc winsup/cygwin/fhandler_nodevice.cc winsup/cygwin/fhandler_proc.cc winsup/cygwin/fhandler_process.cc winsup/cygwin/fhandler_random.cc winsup/cygwin/fhandler_raw.cc winsup/cygwin/fhandler_registry.cc winsup/cygwin/fhandler_serial.cc winsup/cygwin/fhandler_socket.cc winsup/cygwin/fhandler_tape.cc winsup/cygwin/fhandler_termios.cc winsup/cygwin/fhandler_tty.cc winsup/cygwin/fhandler_virtual.cc winsup/cygwin/fhandler_windows.cc winsup/cygwin/fhandler_zero.cc winsup/cygwin/flock.cc winsup/cygwin/fork.cc winsup/cygwin/gcrt0.c winsup/cygwin/gendef winsup/cygwin/gendevices winsup/cygwin/gentls_offsets winsup/cygwin/glob.c winsup/cygwin/gmon.c winsup/cygwin/gmon.h winsup/cygwin/grp.cc winsup/cygwin/heap.cc winsup/cygwin/heap.h winsup/cygwin/hires.h winsup/cygwin/hookapi.cc winsup/cygwin/how-autoload-works.txt winsup/cygwin/how-cygheap-works.txt winsup/cygwin/how-cygtls-works.txt winsup/cygwin/how-fhandlers-work.txt winsup/cygwin/how-signals-work.txt winsup/cygwin/how-spawn-works.txt winsup/cygwin/how-to-debug-cygwin.txt winsup/cygwin/how-vfork-works.txt winsup/cygwin/include/a.out.h winsup/cygwin/include/arpa/ftp.h winsup/cygwin/include/arpa/inet.h winsup/cygwin/include/arpa/telnet.h winsup/cygwin/include/asm/byteorder.h winsup/cygwin/include/asm/socket.h winsup/cygwin/include/asm/types.h winsup/cygwin/include/byteswap.h winsup/cygwin/include/ctype.h winsup/cygwin/include/cygwin/_types.h winsup/cygwin/include/cygwin/acl.h winsup/cygwin/include/cygwin/config.h winsup/cygwin/include/cygwin/core_dump.h winsup/cygwin/include/cygwin/cygwin_dll.h winsup/cygwin/include/cygwin/fs.h winsup/cygwin/include/cygwin/grp.h winsup/cygwin/include/cygwin/hdreg.h winsup/cygwin/include/cygwin/icmp.h winsup/cygwin/include/cygwin/if.h winsup/cygwin/include/cygwin/in.h winsup/cygwin/include/cygwin/in_systm.h winsup/cygwin/include/cygwin/ipc.h winsup/cygwin/include/cygwin/msg.h winsup/cygwin/include/cygwin/mtio.h winsup/cygwin/include/cygwin/rdevio.h winsup/cygwin/include/cygwin/sem.h winsup/cygwin/include/cygwin/shm.h winsup/cygwin/include/cygwin/signal.h winsup/cygwin/include/cygwin/socket.h winsup/cygwin/include/cygwin/sockios.h winsup/cygwin/include/cygwin/stat.h winsup/cygwin/include/cygwin/stdlib.h winsup/cygwin/include/cygwin/sys_time.h winsup/cygwin/include/cygwin/sysproto.h winsup/cygwin/include/cygwin/time.h winsup/cygwin/include/cygwin/types.h winsup/cygwin/include/cygwin/uio.h winsup/cygwin/include/cygwin/utmp.h winsup/cygwin/include/cygwin/version.h winsup/cygwin/include/dlfcn.h winsup/cygwin/include/elf.h winsup/cygwin/include/endian.h winsup/cygwin/include/err.h winsup/cygwin/include/exceptions.h winsup/cygwin/include/fcntl.h winsup/cygwin/include/features.h winsup/cygwin/include/fnmatch.h winsup/cygwin/include/fts.h winsup/cygwin/include/ftw.h winsup/cygwin/include/getopt.h winsup/cygwin/include/glob.h winsup/cygwin/include/icmp.h winsup/cygwin/include/inttypes.h winsup/cygwin/include/io.h winsup/cygwin/include/lastlog.h winsup/cygwin/include/libgen.h winsup/cygwin/include/limits.h winsup/cygwin/include/machine/stdlib.h winsup/cygwin/include/mapi.h winsup/cygwin/include/memory.h winsup/cygwin/include/mntent.h winsup/cygwin/include/net/if.h winsup/cygwin/include/netdb.h winsup/cygwin/include/netinet/in.h winsup/cygwin/include/netinet/in_systm.h winsup/cygwin/include/netinet/ip.h winsup/cygwin/include/netinet/ip_icmp.h winsup/cygwin/include/netinet/tcp.h winsup/cygwin/include/netinet/udp.h winsup/cygwin/include/paths.h winsup/cygwin/include/poll.h winsup/cygwin/include/pthread.h winsup/cygwin/include/pty.h winsup/cygwin/include/sched.h winsup/cygwin/include/search.h winsup/cygwin/include/semaphore.h winsup/cygwin/include/stdint.h winsup/cygwin/include/strings.h winsup/cygwin/include/sys/acl.h winsup/cygwin/include/sys/cdefs.h winsup/cygwin/include/sys/copying.dj winsup/cygwin/include/sys/cygwin.h winsup/cygwin/include/sys/dirent.h winsup/cygwin/include/sys/elf32.h winsup/cygwin/include/sys/elf64.h winsup/cygwin/include/sys/elf_common.h winsup/cygwin/include/sys/elf_generic.h winsup/cygwin/include/sys/file.h winsup/cygwin/include/sys/ioctl.h winsup/cygwin/include/sys/ipc.h winsup/cygwin/include/sys/lock.h winsup/cygwin/include/sys/mman.h winsup/cygwin/include/sys/mount.h winsup/cygwin/include/sys/msg.h winsup/cygwin/include/sys/mtio.h winsup/cygwin/include/sys/param.h winsup/cygwin/include/sys/poll.h winsup/cygwin/include/sys/procfs.h winsup/cygwin/include/sys/queue.h winsup/cygwin/include/sys/resource.h winsup/cygwin/include/sys/select.h winsup/cygwin/include/sys/sem.h winsup/cygwin/include/sys/shm.h winsup/cygwin/include/sys/smallprint.h winsup/cygwin/include/sys/socket.h winsup/cygwin/include/sys/soundcard.h winsup/cygwin/include/sys/statfs.h winsup/cygwin/include/sys/statvfs.h winsup/cygwin/include/sys/stdio.h winsup/cygwin/include/sys/strace.h winsup/cygwin/include/sys/syslog.h winsup/cygwin/include/sys/sysmacros.h winsup/cygwin/include/sys/sysproto.h winsup/cygwin/include/sys/termio.h winsup/cygwin/include/sys/termios.h winsup/cygwin/include/sys/ttychars.h winsup/cygwin/include/sys/uio.h winsup/cygwin/include/sys/un.h winsup/cygwin/include/sys/utime.h winsup/cygwin/include/sys/utmp.h winsup/cygwin/include/sys/utsname.h winsup/cygwin/include/sys/vfs.h winsup/cygwin/include/sys/wait.h winsup/cygwin/include/sysexits.h winsup/cygwin/include/syslog.h winsup/cygwin/include/termio.h winsup/cygwin/include/tzfile.h winsup/cygwin/include/utmpx.h winsup/cygwin/init.cc winsup/cygwin/ioctl.cc winsup/cygwin/ipc.cc winsup/cygwin/lib/_cygwin_crt0_common.cc winsup/cygwin/lib/crt0.h winsup/cygwin/lib/cygwin_attach_dll.c winsup/cygwin/lib/cygwin_crt0.c winsup/cygwin/lib/dll_entry.c winsup/cygwin/lib/dll_main.cc winsup/cygwin/lib/libcmain.c winsup/cygwin/lib/premain0.c winsup/cygwin/lib/premain1.c winsup/cygwin/lib/premain2.c winsup/cygwin/lib/premain3.c winsup/cygwin/lib/pseudo-reloc.c winsup/cygwin/libc/bsdlib.cc winsup/cygwin/libc/fnmatch.c winsup/cygwin/libc/fts.c winsup/cygwin/libc/ftw.c winsup/cygwin/libc/getopt.c winsup/cygwin/libc/iruserok.c winsup/cygwin/libc/memmem.cc winsup/cygwin/libc/nftw.c winsup/cygwin/libc/strptime.cc winsup/cygwin/libc/timelocal.cc winsup/cygwin/libc/timelocal.h winsup/cygwin/localtime.cc winsup/cygwin/lsearch.cc winsup/cygwin/malloc.cc winsup/cygwin/malloc_wrapper.cc winsup/cygwin/mcount.c winsup/cygwin/misc-std.sgml winsup/cygwin/miscfuncs.cc winsup/cygwin/mktemp.cc winsup/cygwin/mkvers.sh winsup/cygwin/mmap.cc winsup/cygwin/msg.cc winsup/cygwin/mtinfo.h winsup/cygwin/net.cc winsup/cygwin/netdb.cc winsup/cygwin/newsym winsup/cygwin/ntdll.h winsup/cygwin/ntea.cc winsup/cygwin/passwd.cc winsup/cygwin/path.cc winsup/cygwin/path.h winsup/cygwin/path.sgml winsup/cygwin/perprocess.h winsup/cygwin/pinfo.cc winsup/cygwin/pinfo.h winsup/cygwin/pipe.cc winsup/cygwin/poll.cc winsup/cygwin/posix.sgml winsup/cygwin/profil.c winsup/cygwin/profil.h winsup/cygwin/pseudo-reloc.cc winsup/cygwin/pthread.cc winsup/cygwin/pwdgrp.h winsup/cygwin/regex/COPYRIGHT winsup/cygwin/regex/cclass.h winsup/cygwin/regex/cname.h winsup/cygwin/regex/engine.c winsup/cygwin/regex/engine.ih winsup/cygwin/regex/mkh winsup/cygwin/regex/regcomp.c winsup/cygwin/regex/regcomp.ih winsup/cygwin/regex/regerror.c winsup/cygwin/regex/regerror.ih winsup/cygwin/regex/regex.3 winsup/cygwin/regex/regex.7 winsup/cygwin/regex/regex.h winsup/cygwin/regex/regex2.h winsup/cygwin/regex/regexec.c winsup/cygwin/regex/regfree.c winsup/cygwin/regex/tests winsup/cygwin/regex/utils.h winsup/cygwin/regexp/COPYRIGHT winsup/cygwin/regexp/README winsup/cygwin/regexp/regexp.h winsup/cygwin/regexp/regmagic.h winsup/cygwin/regexp/v8_regerror.c winsup/cygwin/regexp/v8_regexp.c winsup/cygwin/regexp/v8_regsub.c winsup/cygwin/registry.cc winsup/cygwin/registry.h winsup/cygwin/resource.cc winsup/cygwin/rmsym winsup/cygwin/scandir.cc winsup/cygwin/sched.cc winsup/cygwin/sec_acl.cc winsup/cygwin/sec_helper.cc winsup/cygwin/security.cc winsup/cygwin/security.h winsup/cygwin/select.cc winsup/cygwin/select.h winsup/cygwin/sem.cc winsup/cygwin/shared.cc winsup/cygwin/shared.sgml winsup/cygwin/shared_info.h winsup/cygwin/shm.cc winsup/cygwin/signal.cc winsup/cygwin/sigproc.cc winsup/cygwin/sigproc.h winsup/cygwin/smallprint.c winsup/cygwin/spawn.cc winsup/cygwin/speclib winsup/cygwin/stackdump.sgml winsup/cygwin/strace.cc winsup/cygwin/string.h winsup/cygwin/strsep.cc winsup/cygwin/strsig.cc winsup/cygwin/sync.cc winsup/cygwin/sync.h winsup/cygwin/syscalls.cc winsup/cygwin/sysconf.cc winsup/cygwin/syslog.cc winsup/cygwin/termios.cc winsup/cygwin/textmode.c winsup/cygwin/textreadmode.c winsup/cygwin/thread.cc winsup/cygwin/thread.h winsup/cygwin/timer.cc winsup/cygwin/times.cc winsup/cygwin/tlsoffsets.h winsup/cygwin/tty.cc winsup/cygwin/tty.h winsup/cygwin/tz_posixrules.h winsup/cygwin/uinfo.cc winsup/cygwin/uname.cc winsup/cygwin/wait.cc winsup/cygwin/winbase.h winsup/cygwin/wincap.cc winsup/cygwin/wincap.h winsup/cygwin/window.cc winsup/cygwin/wininfo.h winsup/cygwin/winsup.h winsup/cygwin/winver.rc winsup/doc/ChangeLog winsup/doc/Makefile.in winsup/doc/README winsup/doc/configure winsup/doc/configure.in winsup/doc/cygserver.sgml winsup/doc/cygwin-api.in.sgml winsup/doc/cygwin-ug-net.in.sgml winsup/doc/cygwin-ug.in.sgml winsup/doc/cygwin.dsl winsup/doc/cygwinenv.sgml winsup/doc/dll.sgml winsup/doc/doctool.c winsup/doc/doctool.txt winsup/doc/effectively.sgml winsup/doc/faq-api.xml winsup/doc/faq-problems.xml winsup/doc/faq-programming.xml winsup/doc/faq-resources.xml winsup/doc/faq-sections.xml winsup/doc/faq-setup.xml winsup/doc/faq-using.xml winsup/doc/faq-what.xml winsup/doc/faq.xml winsup/doc/fhandler-tut.txt winsup/doc/filemodes.sgml winsup/doc/gcc.sgml winsup/doc/gdb.sgml winsup/doc/legal.sgml winsup/doc/ntsec.sgml winsup/doc/overview.sgml winsup/doc/overview2.sgml winsup/doc/pathnames.sgml winsup/doc/programming.sgml winsup/doc/setup-net.sgml winsup/doc/setup.sgml winsup/doc/setup2.sgml winsup/doc/textbinary.sgml winsup/doc/using.sgml winsup/doc/windres.sgml winsup/mingw/CONTRIBUTORS winsup/mingw/CRT_fp10.c winsup/mingw/CRT_fp8.c winsup/mingw/CRT_noglob.c winsup/mingw/CRTfmode.c winsup/mingw/CRTglob.c winsup/mingw/CRTinit.c winsup/mingw/ChangeLog winsup/mingw/DISCLAIMER winsup/mingw/Makefile.in winsup/mingw/README winsup/mingw/TODO winsup/mingw/binmode.c winsup/mingw/config.guess winsup/mingw/config.sub winsup/mingw/configure winsup/mingw/configure.in winsup/mingw/crt1.c winsup/mingw/crtdll.def winsup/mingw/crtmt.c winsup/mingw/crtst.c winsup/mingw/dllcrt1.c winsup/mingw/dllmain.c winsup/mingw/gccmain.c winsup/mingw/include/_mingw.h winsup/mingw/include/assert.h winsup/mingw/include/complex.h winsup/mingw/include/conio.h winsup/mingw/include/ctype.h winsup/mingw/include/dir.h winsup/mingw/include/direct.h winsup/mingw/include/dirent.h winsup/mingw/include/dos.h winsup/mingw/include/errno.h winsup/mingw/include/excpt.h winsup/mingw/include/fcntl.h winsup/mingw/include/fenv.h winsup/mingw/include/float.h winsup/mingw/include/getopt.h winsup/mingw/include/inttypes.h winsup/mingw/include/io.h winsup/mingw/include/limits.h winsup/mingw/include/locale.h winsup/mingw/include/malloc.h winsup/mingw/include/math.h winsup/mingw/include/mbctype.h winsup/mingw/include/mbstring.h winsup/mingw/include/mem.h winsup/mingw/include/memory.h winsup/mingw/include/process.h winsup/mingw/include/search.h winsup/mingw/include/setjmp.h winsup/mingw/include/share.h winsup/mingw/include/signal.h winsup/mingw/include/stdint.h winsup/mingw/include/stdio.h winsup/mingw/include/stdlib.h winsup/mingw/include/string.h winsup/mingw/include/strings.h winsup/mingw/include/sys/fcntl.h winsup/mingw/include/sys/file.h winsup/mingw/include/sys/locking.h winsup/mingw/include/sys/param.h winsup/mingw/include/sys/stat.h winsup/mingw/include/sys/time.h winsup/mingw/include/sys/timeb.h winsup/mingw/include/sys/types.h winsup/mingw/include/sys/unistd.h winsup/mingw/include/sys/utime.h winsup/mingw/include/tchar.h winsup/mingw/include/time.h winsup/mingw/include/unistd.h winsup/mingw/include/utime.h winsup/mingw/include/values.h winsup/mingw/include/varargs.h winsup/mingw/include/wchar.h winsup/mingw/include/wctype.h winsup/mingw/init.c winsup/mingw/install-sh winsup/mingw/isascii.c winsup/mingw/iscsym.c winsup/mingw/iscsymf.c winsup/mingw/jamfile winsup/mingw/main.c winsup/mingw/mingwex/Makefile.in winsup/mingw/mingwex/_Exit.c winsup/mingw/mingwex/atoll.c winsup/mingw/mingwex/btowc.c winsup/mingw/mingwex/complex/cabs.c winsup/mingw/mingwex/complex/cabsf.c winsup/mingw/mingwex/complex/cabsl.c winsup/mingw/mingwex/complex/cacos.c winsup/mingw/mingwex/complex/cacosf.c winsup/mingw/mingwex/complex/cacosh.c winsup/mingw/mingwex/complex/cacoshf.c winsup/mingw/mingwex/complex/cacoshl.c winsup/mingw/mingwex/complex/cacosl.c winsup/mingw/mingwex/complex/carg.c winsup/mingw/mingwex/complex/cargf.c winsup/mingw/mingwex/complex/cargl.c winsup/mingw/mingwex/complex/casin.c winsup/mingw/mingwex/complex/casinf.c winsup/mingw/mingwex/complex/casinh.c winsup/mingw/mingwex/complex/casinhf.c winsup/mingw/mingwex/complex/casinhl.c winsup/mingw/mingwex/complex/casinl.c winsup/mingw/mingwex/complex/catan.c winsup/mingw/mingwex/complex/catanf.c winsup/mingw/mingwex/complex/catanh.c winsup/mingw/mingwex/complex/catanhf.c winsup/mingw/mingwex/complex/catanhl.c winsup/mingw/mingwex/complex/catanl.c winsup/mingw/mingwex/complex/ccos.c winsup/mingw/mingwex/complex/ccosf.c winsup/mingw/mingwex/complex/ccosh.c winsup/mingw/mingwex/complex/ccoshf.c winsup/mingw/mingwex/complex/ccoshl.c winsup/mingw/mingwex/complex/ccosl.c winsup/mingw/mingwex/complex/cexp.c winsup/mingw/mingwex/complex/cexpf.c winsup/mingw/mingwex/complex/cexpl.c winsup/mingw/mingwex/complex/cimag.c winsup/mingw/mingwex/complex/cimagf.c winsup/mingw/mingwex/complex/cimagl.c winsup/mingw/mingwex/complex/clog.c winsup/mingw/mingwex/complex/clogf.c winsup/mingw/mingwex/complex/clogl.c winsup/mingw/mingwex/complex/cpow.c winsup/mingw/mingwex/complex/cpowf.c winsup/mingw/mingwex/complex/cpowl.c winsup/mingw/mingwex/complex/cproj.c winsup/mingw/mingwex/complex/cprojf.c winsup/mingw/mingwex/complex/cprojl.c winsup/mingw/mingwex/complex/creal.c winsup/mingw/mingwex/complex/crealf.c winsup/mingw/mingwex/complex/creall.c winsup/mingw/mingwex/complex/csin.c winsup/mingw/mingwex/complex/csinf.c winsup/mingw/mingwex/complex/csinh.c winsup/mingw/mingwex/complex/csinhf.c winsup/mingw/mingwex/complex/csinhl.c winsup/mingw/mingwex/complex/csinl.c winsup/mingw/mingwex/complex/csqrt.c winsup/mingw/mingwex/complex/csqrtf.c winsup/mingw/mingwex/complex/csqrtl.c winsup/mingw/mingwex/complex/ctan.c winsup/mingw/mingwex/complex/ctanf.c winsup/mingw/mingwex/complex/ctanh.c winsup/mingw/mingwex/complex/ctanhf.c winsup/mingw/mingwex/complex/ctanhl.c winsup/mingw/mingwex/complex/ctanl.c winsup/mingw/mingwex/configure winsup/mingw/mingwex/configure.in winsup/mingw/mingwex/dirent.c winsup/mingw/mingwex/feclearexcept.c winsup/mingw/mingwex/fegetenv.c winsup/mingw/mingwex/fegetexceptflag.c winsup/mingw/mingwex/fegetround.c winsup/mingw/mingwex/feholdexcept.c winsup/mingw/mingwex/feraiseexcept.c winsup/mingw/mingwex/fesetenv.c winsup/mingw/mingwex/fesetexceptflag.c winsup/mingw/mingwex/fesetround.c winsup/mingw/mingwex/fetestexcept.c winsup/mingw/mingwex/feupdateenv.c winsup/mingw/mingwex/ftruncate.c winsup/mingw/mingwex/fwide.c winsup/mingw/mingwex/getopt.c winsup/mingw/mingwex/imaxabs.c winsup/mingw/mingwex/imaxdiv.c winsup/mingw/mingwex/ldtoa.c winsup/mingw/mingwex/lltoa.c winsup/mingw/mingwex/lltow.c winsup/mingw/mingwex/math/acosf.c winsup/mingw/mingwex/math/acosh.c winsup/mingw/mingwex/math/acoshf.c winsup/mingw/mingwex/math/acoshl.c winsup/mingw/mingwex/math/acosl.c winsup/mingw/mingwex/math/asinf.c winsup/mingw/mingwex/math/asinh.c winsup/mingw/mingwex/math/asinhf.c winsup/mingw/mingwex/math/asinhl.c winsup/mingw/mingwex/math/asinl.c winsup/mingw/mingwex/math/atan2f.c winsup/mingw/mingwex/math/atan2l.c winsup/mingw/mingwex/math/atanf.c winsup/mingw/mingwex/math/atanh.c winsup/mingw/mingwex/math/atanhf.c winsup/mingw/mingwex/math/atanhl.c winsup/mingw/mingwex/math/atanl.c winsup/mingw/mingwex/math/cbrt.c winsup/mingw/mingwex/math/cbrtf.c winsup/mingw/mingwex/math/cbrtl.c winsup/mingw/mingwex/math/ceilf.S winsup/mingw/mingwex/math/ceill.S winsup/mingw/mingwex/math/cephes_emath.c winsup/mingw/mingwex/math/cephes_emath.h winsup/mingw/mingwex/math/cephes_mconf.h winsup/mingw/mingwex/math/copysign.S winsup/mingw/mingwex/math/copysignf.S winsup/mingw/mingwex/math/copysignl.S winsup/mingw/mingwex/math/cosf.S winsup/mingw/mingwex/math/coshf.c winsup/mingw/mingwex/math/coshl.c winsup/mingw/mingwex/math/cosl.S winsup/mingw/mingwex/math/erfl.c winsup/mingw/mingwex/math/exp2.S winsup/mingw/mingwex/math/exp2f.S winsup/mingw/mingwex/math/exp2l.S winsup/mingw/mingwex/math/expf.c winsup/mingw/mingwex/math/expl.c winsup/mingw/mingwex/math/expm1.c winsup/mingw/mingwex/math/expm1f.c winsup/mingw/mingwex/math/expm1l.c winsup/mingw/mingwex/math/fabs.c winsup/mingw/mingwex/math/fabsf.c winsup/mingw/mingwex/math/fabsl.c winsup/mingw/mingwex/math/fastmath.h winsup/mingw/mingwex/math/fdim.c winsup/mingw/mingwex/math/fdimf.c winsup/mingw/mingwex/math/fdiml.c winsup/mingw/mingwex/math/floorf.S winsup/mingw/mingwex/math/floorl.S winsup/mingw/mingwex/math/fma.S winsup/mingw/mingwex/math/fmaf.S winsup/mingw/mingwex/math/fmal.c winsup/mingw/mingwex/math/fmax.c winsup/mingw/mingwex/math/fmaxf.c winsup/mingw/mingwex/math/fmaxl.c winsup/mingw/mingwex/math/fmin.c winsup/mingw/mingwex/math/fminf.c winsup/mingw/mingwex/math/fminl.c winsup/mingw/mingwex/math/fmodf.c winsup/mingw/mingwex/math/fmodl.c winsup/mingw/mingwex/math/fp_consts.c winsup/mingw/mingwex/math/fp_consts.h winsup/mingw/mingwex/math/fp_constsf.c winsup/mingw/mingwex/math/fp_constsl.c winsup/mingw/mingwex/math/fpclassify.c winsup/mingw/mingwex/math/fpclassifyf.c winsup/mingw/mingwex/math/fpclassifyl.c winsup/mingw/mingwex/math/frexpf.c winsup/mingw/mingwex/math/frexpl.S winsup/mingw/mingwex/math/fucom.c winsup/mingw/mingwex/math/hypotf.c winsup/mingw/mingwex/math/hypotl.c winsup/mingw/mingwex/math/ilogb.S winsup/mingw/mingwex/math/ilogbf.S winsup/mingw/mingwex/math/ilogbl.S winsup/mingw/mingwex/math/isnan.c winsup/mingw/mingwex/math/isnanf.c winsup/mingw/mingwex/math/isnanl.c winsup/mingw/mingwex/math/ldexpf.c winsup/mingw/mingwex/math/ldexpl.c winsup/mingw/mingwex/math/lgamma.c winsup/mingw/mingwex/math/lgammaf.c winsup/mingw/mingwex/math/lgammal.c winsup/mingw/mingwex/math/llrint.c winsup/mingw/mingwex/math/llrintf.c winsup/mingw/mingwex/math/llrintl.c winsup/mingw/mingwex/math/llround.c winsup/mingw/mingwex/math/llroundf.c winsup/mingw/mingwex/math/llroundl.c winsup/mingw/mingwex/math/log10f.S winsup/mingw/mingwex/math/log10l.S winsup/mingw/mingwex/math/log1p.S winsup/mingw/mingwex/math/log1pf.S winsup/mingw/mingwex/math/log1pl.S winsup/mingw/mingwex/math/log2.S winsup/mingw/mingwex/math/log2f.S winsup/mingw/mingwex/math/log2l.S winsup/mingw/mingwex/math/logb.c winsup/mingw/mingwex/math/logbf.c winsup/mingw/mingwex/math/logbl.c winsup/mingw/mingwex/math/logf.S winsup/mingw/mingwex/math/logl.S winsup/mingw/mingwex/math/lrint.c winsup/mingw/mingwex/math/lrintf.c winsup/mingw/mingwex/math/lrintl.c winsup/mingw/mingwex/math/lround.c winsup/mingw/mingwex/math/lroundf.c winsup/mingw/mingwex/math/lroundl.c winsup/mingw/mingwex/math/modff.c winsup/mingw/mingwex/math/modfl.c winsup/mingw/mingwex/math/nearbyint.S winsup/mingw/mingwex/math/nearbyintf.S winsup/mingw/mingwex/math/nearbyintl.S winsup/mingw/mingwex/math/nextafterf.c winsup/mingw/mingwex/math/nextafterl.c winsup/mingw/mingwex/math/nexttoward.c winsup/mingw/mingwex/math/nexttowardf.c winsup/mingw/mingwex/math/pow.c winsup/mingw/mingwex/math/powf.c winsup/mingw/mingwex/math/powi.c winsup/mingw/mingwex/math/powif.c winsup/mingw/mingwex/math/powil.c winsup/mingw/mingwex/math/powl.c winsup/mingw/mingwex/math/remainder.S winsup/mingw/mingwex/math/remainderf.S winsup/mingw/mingwex/math/remainderl.S winsup/mingw/mingwex/math/remquo.S winsup/mingw/mingwex/math/remquof.S winsup/mingw/mingwex/math/remquol.S winsup/mingw/mingwex/math/rint.c winsup/mingw/mingwex/math/rintf.c winsup/mingw/mingwex/math/rintl.c winsup/mingw/mingwex/math/round.c winsup/mingw/mingwex/math/roundf.c winsup/mingw/mingwex/math/roundl.c winsup/mingw/mingwex/math/s_erf.c winsup/mingw/mingwex/math/scalbn.S winsup/mingw/mingwex/math/scalbnf.S winsup/mingw/mingwex/math/scalbnl.S winsup/mingw/mingwex/math/sf_erf.c winsup/mingw/mingwex/math/signbit.c winsup/mingw/mingwex/math/signbitf.c winsup/mingw/mingwex/math/signbitl.c winsup/mingw/mingwex/math/sinf.S winsup/mingw/mingwex/math/sinhf.c winsup/mingw/mingwex/math/sinhl.c winsup/mingw/mingwex/math/sinl.S winsup/mingw/mingwex/math/sqrtf.c winsup/mingw/mingwex/math/sqrtl.c winsup/mingw/mingwex/math/tanf.S winsup/mingw/mingwex/math/tanhf.c winsup/mingw/mingwex/math/tanhl.c winsup/mingw/mingwex/math/tanl.S winsup/mingw/mingwex/math/tgamma.c winsup/mingw/mingwex/math/tgammaf.c winsup/mingw/mingwex/math/tgammal.c winsup/mingw/mingwex/math/trunc.c winsup/mingw/mingwex/math/truncf.c winsup/mingw/mingwex/math/truncl.c winsup/mingw/mingwex/mb_wc_common.h winsup/mingw/mingwex/mbrtowc.c winsup/mingw/mingwex/mbsinit.c winsup/mingw/mingwex/mingw-aligned-malloc.c winsup/mingw/mingwex/mingw-fseek.c winsup/mingw/mingwex/sitest.c winsup/mingw/mingwex/stdio/fopen64.c winsup/mingw/mingwex/stdio/fseeko64.c winsup/mingw/mingwex/stdio/ftello64.c winsup/mingw/mingwex/stdio/lseek64.c winsup/mingw/mingwex/stdio/snprintf.c winsup/mingw/mingwex/stdio/snwprintf.c winsup/mingw/mingwex/stdio/vfscanf.c winsup/mingw/mingwex/stdio/vfwscanf.c winsup/mingw/mingwex/stdio/vscanf.c winsup/mingw/mingwex/stdio/vsnprintf.c winsup/mingw/mingwex/stdio/vsnwprintf.c winsup/mingw/mingwex/stdio/vsscanf.c winsup/mingw/mingwex/stdio/vswscanf.c winsup/mingw/mingwex/stdio/vwscanf.c winsup/mingw/mingwex/strtof.c winsup/mingw/mingwex/strtoimax.c winsup/mingw/mingwex/strtold.c winsup/mingw/mingwex/strtoumax.c winsup/mingw/mingwex/testwmem.c winsup/mingw/mingwex/tst-aligned-malloc.c winsup/mingw/mingwex/ulltoa.c winsup/mingw/mingwex/ulltow.c winsup/mingw/mingwex/wcrtomb.c winsup/mingw/mingwex/wcstof.c winsup/mingw/mingwex/wcstoimax.c winsup/mingw/mingwex/wcstold.c winsup/mingw/mingwex/wcstoumax.c winsup/mingw/mingwex/wctob.c winsup/mingw/mingwex/wctrans.c winsup/mingw/mingwex/wctype.c winsup/mingw/mingwex/wdirent.c winsup/mingw/mingwex/wmemchr.c winsup/mingw/mingwex/wmemcmp.c winsup/mingw/mingwex/wmemcpy.c winsup/mingw/mingwex/wmemmove.c winsup/mingw/mingwex/wmemset.c winsup/mingw/mingwex/wtoll.c winsup/mingw/mkinstalldirs winsup/mingw/moldname.def.in winsup/mingw/msvcrt.def.in winsup/mingw/mthr.c winsup/mingw/mthr_init.c winsup/mingw/mthr_stub.c winsup/mingw/profile/COPYING winsup/mingw/profile/CYGWIN_LICENSE winsup/mingw/profile/Makefile.in winsup/mingw/profile/configure winsup/mingw/profile/configure.in winsup/mingw/profile/gcrt0.c winsup/mingw/profile/gmon.c winsup/mingw/profile/gmon.h winsup/mingw/profile/mcount.c winsup/mingw/profile/profil.c winsup/mingw/profile/profil.h winsup/mingw/profile/profile.h winsup/mingw/pseudo-reloc-list.c winsup/mingw/pseudo-reloc.c winsup/mingw/readme.txt winsup/mingw/samples/dirent/jamfile winsup/mingw/samples/dirent/test.c winsup/mingw/samples/dirent/wtest.c winsup/mingw/samples/dlltest/dll.c winsup/mingw/samples/dlltest/dll.def winsup/mingw/samples/dlltest/dll.h winsup/mingw/samples/dlltest/exe.c winsup/mingw/samples/dlltest/exe.exp winsup/mingw/samples/dlltest/expexe.c winsup/mingw/samples/dlltest/expexe.def winsup/mingw/samples/dlltest/jamfile winsup/mingw/samples/dlltest/loaddll.c winsup/mingw/samples/dlltest/loadexe.c winsup/mingw/samples/dlltest/readme.txt winsup/mingw/samples/dlltest/silly.cpp winsup/mingw/samples/dlltest/silly.def winsup/mingw/samples/dlltest/silly.exp winsup/mingw/samples/dlltest/silly.h winsup/mingw/samples/dlltest/sillydll.cpp winsup/mingw/samples/filehand/filehand.c winsup/mingw/samples/filehand/jamfile winsup/mingw/samples/filehand/junk.txt winsup/mingw/samples/fixargv/fixargv.c winsup/mingw/samples/fixargv/fixargv.h winsup/mingw/samples/fixargv/readme.txt winsup/mingw/samples/fmode/all.c winsup/mingw/samples/fmode/jamfile winsup/mingw/samples/fmode/readme.txt winsup/mingw/samples/fmode/test.c winsup/mingw/samples/fmode/test2.c winsup/mingw/samples/globbing/glob.c winsup/mingw/samples/globbing/jamfile winsup/mingw/samples/globbing/noglob.c winsup/mingw/samples/globbing/readme.txt winsup/mingw/samples/print/jamfile winsup/mingw/samples/print/prntest.c winsup/mingw/samples/seh/eh3.c winsup/mingw/samples/seh/exutil.c winsup/mingw/samples/seh/exutil.def winsup/mingw/samples/seh/exutil.h winsup/mingw/samples/seh/jamfile winsup/mingw/samples/seh/sehfix.c winsup/mingw/samples/seh/sehsub.c winsup/mingw/samples/seh/sehtest.c winsup/mingw/samples/simpledll/dll.c winsup/mingw/samples/simpledll/dll.cpp winsup/mingw/samples/simpledll/dll.def winsup/mingw/samples/simpledll/exe.c winsup/mingw/samples/simpledll/jamfile winsup/mingw/samples/simpledll/makedll.bat winsup/mingw/samples/test/jamfile winsup/mingw/samples/test/test.c winsup/mingw/samples/wintest/jamfile winsup/mingw/samples/wintest/test.c winsup/mingw/strcasecmp.c winsup/mingw/strncasecmp.c winsup/mingw/test_headers.c winsup/mingw/toascii.c winsup/mingw/txtmode.c winsup/mingw/wcscmpi.c winsup/subauth/ChangeLog winsup/subauth/Makefile.in winsup/subauth/configure winsup/subauth/configure.in winsup/subauth/cygsuba.c winsup/subauth/cygsuba.din winsup/testsuite/ChangeLog winsup/testsuite/Makefile.in winsup/testsuite/README winsup/testsuite/config/default.exp winsup/testsuite/configure winsup/testsuite/configure.in winsup/testsuite/cygrun.c winsup/testsuite/libltp/include/dataascii.h winsup/testsuite/libltp/include/databin.h winsup/testsuite/libltp/include/file_lock.h winsup/testsuite/libltp/include/forker.h winsup/testsuite/libltp/include/open_flags.h winsup/testsuite/libltp/include/pattern.h winsup/testsuite/libltp/include/random_range.h winsup/testsuite/libltp/include/rmobj.h winsup/testsuite/libltp/include/search_path.h winsup/testsuite/libltp/include/str_to_bytes.h winsup/testsuite/libltp/include/string_to_tokens.h winsup/testsuite/libltp/include/test.h winsup/testsuite/libltp/include/tlibio.h winsup/testsuite/libltp/include/usctest.h winsup/testsuite/libltp/include/write_log.h winsup/testsuite/libltp/lib/dataascii.c winsup/testsuite/libltp/lib/databin.c winsup/testsuite/libltp/lib/datapid.c winsup/testsuite/libltp/lib/forker.c winsup/testsuite/libltp/lib/get_high_address.c winsup/testsuite/libltp/lib/libtestsuite.c winsup/testsuite/libltp/lib/open_flags.c winsup/testsuite/libltp/lib/parse_opts.c winsup/testsuite/libltp/lib/pattern.c winsup/testsuite/libltp/lib/rmobj.c winsup/testsuite/libltp/lib/search_path.c winsup/testsuite/libltp/lib/str_to_bytes.c winsup/testsuite/libltp/lib/string_to_tokens.c winsup/testsuite/libltp/lib/tst_res.c winsup/testsuite/libltp/lib/tst_sig.c winsup/testsuite/libltp/lib/tst_tmpdir.c winsup/testsuite/libltp/lib/write_log.c winsup/testsuite/winsup.api/checksignal.c winsup/testsuite/winsup.api/crlf.c winsup/testsuite/winsup.api/cygload.cc winsup/testsuite/winsup.api/cygload.exp winsup/testsuite/winsup.api/cygload.h winsup/testsuite/winsup.api/devdsp.c winsup/testsuite/winsup.api/devdsp_okay.h winsup/testsuite/winsup.api/devzero.c winsup/testsuite/winsup.api/iospeed.c winsup/testsuite/winsup.api/known_bugs.tcl winsup/testsuite/winsup.api/ltp/access01.c winsup/testsuite/winsup.api/ltp/access03.c winsup/testsuite/winsup.api/ltp/access04.c winsup/testsuite/winsup.api/ltp/access05.c winsup/testsuite/winsup.api/ltp/alarm01.c winsup/testsuite/winsup.api/ltp/alarm02.c winsup/testsuite/winsup.api/ltp/alarm03.c winsup/testsuite/winsup.api/ltp/alarm07.c winsup/testsuite/winsup.api/ltp/asyncio02.c winsup/testsuite/winsup.api/ltp/chdir02.c winsup/testsuite/winsup.api/ltp/chdir04.c winsup/testsuite/winsup.api/ltp/chmod01.c winsup/testsuite/winsup.api/ltp/chmod02.c winsup/testsuite/winsup.api/ltp/chown01.c winsup/testsuite/winsup.api/ltp/close01.c winsup/testsuite/winsup.api/ltp/close02.c winsup/testsuite/winsup.api/ltp/close08.c winsup/testsuite/winsup.api/ltp/creat01.c winsup/testsuite/winsup.api/ltp/creat03.c winsup/testsuite/winsup.api/ltp/creat09.c winsup/testsuite/winsup.api/ltp/dup01.c winsup/testsuite/winsup.api/ltp/dup02.c winsup/testsuite/winsup.api/ltp/dup03.c winsup/testsuite/winsup.api/ltp/dup04.c winsup/testsuite/winsup.api/ltp/dup05.c winsup/testsuite/winsup.api/ltp/execl01.c winsup/testsuite/winsup.api/ltp/execle01.c winsup/testsuite/winsup.api/ltp/execlp01.c winsup/testsuite/winsup.api/ltp/execv01.c winsup/testsuite/winsup.api/ltp/execve01.c winsup/testsuite/winsup.api/ltp/execvp01.c winsup/testsuite/winsup.api/ltp/exit01.c winsup/testsuite/winsup.api/ltp/exit02.c winsup/testsuite/winsup.api/ltp/fchdir01.c winsup/testsuite/winsup.api/ltp/fchdir02.c winsup/testsuite/winsup.api/ltp/fchmod01.c winsup/testsuite/winsup.api/ltp/fchown01.c winsup/testsuite/winsup.api/ltp/fcntl02.c winsup/testsuite/winsup.api/ltp/fcntl03.c winsup/testsuite/winsup.api/ltp/fcntl04.c winsup/testsuite/winsup.api/ltp/fcntl05.c winsup/testsuite/winsup.api/ltp/fcntl07.c winsup/testsuite/winsup.api/ltp/fcntl07B.c winsup/testsuite/winsup.api/ltp/fcntl08.c winsup/testsuite/winsup.api/ltp/fcntl09.c winsup/testsuite/winsup.api/ltp/fcntl10.c winsup/testsuite/winsup.api/ltp/fork01.c winsup/testsuite/winsup.api/ltp/fork02.c winsup/testsuite/winsup.api/ltp/fork03.c winsup/testsuite/winsup.api/ltp/fork04.c winsup/testsuite/winsup.api/ltp/fork06.c winsup/testsuite/winsup.api/ltp/fork07.c winsup/testsuite/winsup.api/ltp/fork09.c winsup/testsuite/winsup.api/ltp/fork10.c winsup/testsuite/winsup.api/ltp/fork11.c winsup/testsuite/winsup.api/ltp/fpathconf01.c winsup/testsuite/winsup.api/ltp/fstat01.c winsup/testsuite/winsup.api/ltp/fstat02.c winsup/testsuite/winsup.api/ltp/fstat03.c winsup/testsuite/winsup.api/ltp/fstat04.c winsup/testsuite/winsup.api/ltp/fsync01.c winsup/testsuite/winsup.api/ltp/ftruncate01.c winsup/testsuite/winsup.api/ltp/ftruncate02.c winsup/testsuite/winsup.api/ltp/ftruncate03.c winsup/testsuite/winsup.api/ltp/getegid01.c winsup/testsuite/winsup.api/ltp/geteuid01.c winsup/testsuite/winsup.api/ltp/getgid01.c winsup/testsuite/winsup.api/ltp/getgid02.c winsup/testsuite/winsup.api/ltp/getgid03.c winsup/testsuite/winsup.api/ltp/getgroups01.c winsup/testsuite/winsup.api/ltp/getgroups02.c winsup/testsuite/winsup.api/ltp/gethostid01.c winsup/testsuite/winsup.api/ltp/gethostname01.c winsup/testsuite/winsup.api/ltp/getpgid01.c winsup/testsuite/winsup.api/ltp/getpgid02.c winsup/testsuite/winsup.api/ltp/getpgrp01.c winsup/testsuite/winsup.api/ltp/getpid01.c winsup/testsuite/winsup.api/ltp/getpid02.c winsup/testsuite/winsup.api/ltp/getppid01.c winsup/testsuite/winsup.api/ltp/getppid02.c winsup/testsuite/winsup.api/ltp/getuid01.c winsup/testsuite/winsup.api/ltp/getuid02.c winsup/testsuite/winsup.api/ltp/getuid03.c winsup/testsuite/winsup.api/ltp/kill01.c winsup/testsuite/winsup.api/ltp/kill02.c winsup/testsuite/winsup.api/ltp/kill03.c winsup/testsuite/winsup.api/ltp/kill04.c winsup/testsuite/winsup.api/ltp/kill09.c winsup/testsuite/winsup.api/ltp/link02.c winsup/testsuite/winsup.api/ltp/link03.c winsup/testsuite/winsup.api/ltp/link04.c winsup/testsuite/winsup.api/ltp/link05.c winsup/testsuite/winsup.api/ltp/lseek01.c winsup/testsuite/winsup.api/ltp/lseek02.c winsup/testsuite/winsup.api/ltp/lseek03.c winsup/testsuite/winsup.api/ltp/lseek04.c winsup/testsuite/winsup.api/ltp/lseek05.c winsup/testsuite/winsup.api/ltp/lseek06.c winsup/testsuite/winsup.api/ltp/lseek07.c winsup/testsuite/winsup.api/ltp/lseek08.c winsup/testsuite/winsup.api/ltp/lseek09.c winsup/testsuite/winsup.api/ltp/lseek10.c winsup/testsuite/winsup.api/ltp/lstat02.c winsup/testsuite/winsup.api/ltp/mkdir01.c winsup/testsuite/winsup.api/ltp/mkdir08.c winsup/testsuite/winsup.api/ltp/mknod01.c winsup/testsuite/winsup.api/ltp/mmap001.c winsup/testsuite/winsup.api/ltp/mmap02.c winsup/testsuite/winsup.api/ltp/mmap03.c winsup/testsuite/winsup.api/ltp/mmap04.c winsup/testsuite/winsup.api/ltp/mmap05.c winsup/testsuite/winsup.api/ltp/mmap06.c winsup/testsuite/winsup.api/ltp/mmap07.c winsup/testsuite/winsup.api/ltp/mmap08.c winsup/testsuite/winsup.api/ltp/munmap01.c winsup/testsuite/winsup.api/ltp/munmap02.c winsup/testsuite/winsup.api/ltp/nice05.c winsup/testsuite/winsup.api/ltp/open02.c winsup/testsuite/winsup.api/ltp/open03.c winsup/testsuite/winsup.api/ltp/pathconf01.c winsup/testsuite/winsup.api/ltp/pause01.c winsup/testsuite/winsup.api/ltp/pipe01.c winsup/testsuite/winsup.api/ltp/pipe08.c winsup/testsuite/winsup.api/ltp/pipe09.c winsup/testsuite/winsup.api/ltp/pipe10.c winsup/testsuite/winsup.api/ltp/pipe11.c winsup/testsuite/winsup.api/ltp/poll01.c winsup/testsuite/winsup.api/ltp/read01.c winsup/testsuite/winsup.api/ltp/read04.c winsup/testsuite/winsup.api/ltp/readdir01.c winsup/testsuite/winsup.api/ltp/readlink01.c winsup/testsuite/winsup.api/ltp/readlink02.c winsup/testsuite/winsup.api/ltp/readlink03.c winsup/testsuite/winsup.api/ltp/rename01.c winsup/testsuite/winsup.api/ltp/rename02.c winsup/testsuite/winsup.api/ltp/rename08.c winsup/testsuite/winsup.api/ltp/rename10.c winsup/testsuite/winsup.api/ltp/rmdir01.c winsup/testsuite/winsup.api/ltp/rmdir04.c winsup/testsuite/winsup.api/ltp/rmdir05.c winsup/testsuite/winsup.api/ltp/sbrk01.c winsup/testsuite/winsup.api/ltp/select01.c winsup/testsuite/winsup.api/ltp/select02.c winsup/testsuite/winsup.api/ltp/select03.c winsup/testsuite/winsup.api/ltp/setgid01.c winsup/testsuite/winsup.api/ltp/setgroups01.c winsup/testsuite/winsup.api/ltp/setpgid01.c winsup/testsuite/winsup.api/ltp/setregid01.c winsup/testsuite/winsup.api/ltp/setreuid01.c winsup/testsuite/winsup.api/ltp/setuid01.c winsup/testsuite/winsup.api/ltp/setuid02.c winsup/testsuite/winsup.api/ltp/signal03.c winsup/testsuite/winsup.api/ltp/stat01.c winsup/testsuite/winsup.api/ltp/stat02.c winsup/testsuite/winsup.api/ltp/stat03.c winsup/testsuite/winsup.api/ltp/stat05.c winsup/testsuite/winsup.api/ltp/stat06.c winsup/testsuite/winsup.api/ltp/symlink01.c winsup/testsuite/winsup.api/ltp/symlink02.c winsup/testsuite/winsup.api/ltp/symlink03.c winsup/testsuite/winsup.api/ltp/symlink04.c winsup/testsuite/winsup.api/ltp/symlink05.c winsup/testsuite/winsup.api/ltp/sync01.c winsup/testsuite/winsup.api/ltp/sync02.c winsup/testsuite/winsup.api/ltp/time01.c winsup/testsuite/winsup.api/ltp/time02.c winsup/testsuite/winsup.api/ltp/times01.c winsup/testsuite/winsup.api/ltp/times02.c winsup/testsuite/winsup.api/ltp/times03.c winsup/testsuite/winsup.api/ltp/truncate01.c winsup/testsuite/winsup.api/ltp/truncate02.c winsup/testsuite/winsup.api/ltp/ulimit01.c winsup/testsuite/winsup.api/ltp/umask01.c winsup/testsuite/winsup.api/ltp/umask02.c winsup/testsuite/winsup.api/ltp/umask03.c winsup/testsuite/winsup.api/ltp/uname01.c winsup/testsuite/winsup.api/ltp/unlink05.c winsup/testsuite/winsup.api/ltp/unlink06.c winsup/testsuite/winsup.api/ltp/unlink07.c winsup/testsuite/winsup.api/ltp/unlink08.c winsup/testsuite/winsup.api/ltp/vfork01.c winsup/testsuite/winsup.api/ltp/wait02.c winsup/testsuite/winsup.api/ltp/wait401.c winsup/testsuite/winsup.api/ltp/wait402.c winsup/testsuite/winsup.api/ltp/write01.c winsup/testsuite/winsup.api/ltp/write02.c winsup/testsuite/winsup.api/ltp/write03.c winsup/testsuite/winsup.api/mmaptest01.c winsup/testsuite/winsup.api/mmaptest02.c winsup/testsuite/winsup.api/mmaptest03.c winsup/testsuite/winsup.api/mmaptest04.c winsup/testsuite/winsup.api/msgtest.c winsup/testsuite/winsup.api/nullgetcwd.c winsup/testsuite/winsup.api/pthread/cancel1.c winsup/testsuite/winsup.api/pthread/cancel10.c winsup/testsuite/winsup.api/pthread/cancel11.c winsup/testsuite/winsup.api/pthread/cancel12.c winsup/testsuite/winsup.api/pthread/cancel2.c winsup/testsuite/winsup.api/pthread/cancel3.c winsup/testsuite/winsup.api/pthread/cancel4.c winsup/testsuite/winsup.api/pthread/cancel5.c winsup/testsuite/winsup.api/pthread/cancel6.c winsup/testsuite/winsup.api/pthread/cancel7.c winsup/testsuite/winsup.api/pthread/cancel8.c winsup/testsuite/winsup.api/pthread/cancel9.c winsup/testsuite/winsup.api/pthread/cleanup2.c winsup/testsuite/winsup.api/pthread/cleanup3.c winsup/testsuite/winsup.api/pthread/condvar1.c winsup/testsuite/winsup.api/pthread/condvar2.c winsup/testsuite/winsup.api/pthread/condvar2_1.c winsup/testsuite/winsup.api/pthread/condvar3.c winsup/testsuite/winsup.api/pthread/condvar3_1.c winsup/testsuite/winsup.api/pthread/condvar3_2.c winsup/testsuite/winsup.api/pthread/condvar3_3.c winsup/testsuite/winsup.api/pthread/condvar4.c winsup/testsuite/winsup.api/pthread/condvar5.c winsup/testsuite/winsup.api/pthread/condvar6.c winsup/testsuite/winsup.api/pthread/condvar7.c winsup/testsuite/winsup.api/pthread/condvar8.c winsup/testsuite/winsup.api/pthread/condvar9.c winsup/testsuite/winsup.api/pthread/count1.c winsup/testsuite/winsup.api/pthread/create1.c winsup/testsuite/winsup.api/pthread/create2.c winsup/testsuite/winsup.api/pthread/equal1.c winsup/testsuite/winsup.api/pthread/exit1.c winsup/testsuite/winsup.api/pthread/exit2.c winsup/testsuite/winsup.api/pthread/exit3.c winsup/testsuite/winsup.api/pthread/inherit1.c winsup/testsuite/winsup.api/pthread/join0.c winsup/testsuite/winsup.api/pthread/join1.c winsup/testsuite/winsup.api/pthread/join2.c winsup/testsuite/winsup.api/pthread/mainthreadexits.c winsup/testsuite/winsup.api/pthread/mutex1.c winsup/testsuite/winsup.api/pthread/mutex1d.c winsup/testsuite/winsup.api/pthread/mutex1e.c winsup/testsuite/winsup.api/pthread/mutex1n.c winsup/testsuite/winsup.api/pthread/mutex1r.c winsup/testsuite/winsup.api/pthread/mutex2.c winsup/testsuite/winsup.api/pthread/mutex3.c winsup/testsuite/winsup.api/pthread/mutex4.c winsup/testsuite/winsup.api/pthread/mutex5.c winsup/testsuite/winsup.api/pthread/mutex6d.c winsup/testsuite/winsup.api/pthread/mutex6e.c winsup/testsuite/winsup.api/pthread/mutex6n.c winsup/testsuite/winsup.api/pthread/mutex6r.c winsup/testsuite/winsup.api/pthread/mutex7.c winsup/testsuite/winsup.api/pthread/mutex7d.c winsup/testsuite/winsup.api/pthread/mutex7e.c winsup/testsuite/winsup.api/pthread/mutex7n.c winsup/testsuite/winsup.api/pthread/mutex7r.c winsup/testsuite/winsup.api/pthread/mutex8e.c winsup/testsuite/winsup.api/pthread/mutex8n.c winsup/testsuite/winsup.api/pthread/mutex8r.c winsup/testsuite/winsup.api/pthread/once1.c winsup/testsuite/winsup.api/pthread/priority1.c winsup/testsuite/winsup.api/pthread/priority2.c winsup/testsuite/winsup.api/pthread/rwlock1.c winsup/testsuite/winsup.api/pthread/rwlock2.c winsup/testsuite/winsup.api/pthread/rwlock3.c winsup/testsuite/winsup.api/pthread/rwlock4.c winsup/testsuite/winsup.api/pthread/rwlock5.c winsup/testsuite/winsup.api/pthread/rwlock6.c winsup/testsuite/winsup.api/pthread/rwlock7.c winsup/testsuite/winsup.api/pthread/self1.c winsup/testsuite/winsup.api/pthread/self2.c winsup/testsuite/winsup.api/pthread/test.h winsup/testsuite/winsup.api/pthread/threadidafterfork.c winsup/testsuite/winsup.api/pthread/tsd1.c winsup/testsuite/winsup.api/resethand.c winsup/testsuite/winsup.api/samples/sample-fail.c winsup/testsuite/winsup.api/samples/sample-miscompile.c winsup/testsuite/winsup.api/samples/sample-pass.c winsup/testsuite/winsup.api/semtest.c winsup/testsuite/winsup.api/shmtest.c winsup/testsuite/winsup.api/sigchld.c winsup/testsuite/winsup.api/signal-into-win32-api.c winsup/testsuite/winsup.api/systemcall.c winsup/testsuite/winsup.api/waitpid.c winsup/testsuite/winsup.api/winsup.exp winsup/utils/ChangeLog winsup/utils/ChangeLog-2000 winsup/utils/Makefile.in winsup/utils/aclocal.m4 winsup/utils/configure winsup/utils/configure.in winsup/utils/cygcheck.cc winsup/utils/cygpath.cc winsup/utils/dump_setup.cc winsup/utils/dumper.cc winsup/utils/dumper.h winsup/utils/getfacl.c winsup/utils/ipcrm.c winsup/utils/ipcs.c winsup/utils/kill.cc winsup/utils/mkgroup.c winsup/utils/mkpasswd.c winsup/utils/module_info.cc winsup/utils/mount.cc winsup/utils/parse_pe.cc winsup/utils/passwd.c winsup/utils/path.cc winsup/utils/path.h winsup/utils/ps.cc winsup/utils/regtool.cc winsup/utils/setfacl.c winsup/utils/ssp.c winsup/utils/ssp.txt winsup/utils/strace.cc winsup/utils/umount.cc winsup/utils/utils.sgml winsup/w32api/CONTRIBUTIONS winsup/w32api/ChangeLog winsup/w32api/Makefile.in winsup/w32api/README.w32api winsup/w32api/TODO winsup/w32api/config.guess winsup/w32api/config.sub winsup/w32api/configure winsup/w32api/configure.in winsup/w32api/include/GL/gl.h winsup/w32api/include/GL/glext.h winsup/w32api/include/GL/glu.h winsup/w32api/include/accctrl.h winsup/w32api/include/aclapi.h winsup/w32api/include/aclui.h winsup/w32api/include/afxres.h winsup/w32api/include/basetsd.h winsup/w32api/include/basetyps.h winsup/w32api/include/cderr.h winsup/w32api/include/cguid.h winsup/w32api/include/comcat.h winsup/w32api/include/commctrl.h winsup/w32api/include/commdlg.h winsup/w32api/include/cpl.h winsup/w32api/include/cplext.h winsup/w32api/include/custcntl.h winsup/w32api/include/dbt.h winsup/w32api/include/dde.h winsup/w32api/include/ddeml.h winsup/w32api/include/ddk/atm.h winsup/w32api/include/ddk/batclass.h winsup/w32api/include/ddk/cfg.h winsup/w32api/include/ddk/cfgmgr32.h winsup/w32api/include/ddk/d4drvif.h winsup/w32api/include/ddk/d4iface.h winsup/w32api/include/ddk/ddkmapi.h winsup/w32api/include/ddk/hidclass.h winsup/w32api/include/ddk/hidpi.h winsup/w32api/include/ddk/hidsdi.h winsup/w32api/include/ddk/hidusage.h winsup/w32api/include/ddk/kbdmou.h winsup/w32api/include/ddk/mcd.h winsup/w32api/include/ddk/miniport.h winsup/w32api/include/ddk/minitape.h winsup/w32api/include/ddk/mountdev.h winsup/w32api/include/ddk/mountmgr.h winsup/w32api/include/ddk/ndis.h winsup/w32api/include/ddk/ndisguid.h winsup/w32api/include/ddk/ndistapi.h winsup/w32api/include/ddk/ndiswan.h winsup/w32api/include/ddk/netevent.h winsup/w32api/include/ddk/netpnp.h winsup/w32api/include/ddk/newdev.h winsup/w32api/include/ddk/ntapi.h winsup/w32api/include/ddk/ntdd8042.h winsup/w32api/include/ddk/ntddbeep.h winsup/w32api/include/ddk/ntddcdrm.h winsup/w32api/include/ddk/ntddcdvd.h winsup/w32api/include/ddk/ntddchgr.h winsup/w32api/include/ddk/ntdddisk.h winsup/w32api/include/ddk/ntddk.h winsup/w32api/include/ddk/ntddkbd.h winsup/w32api/include/ddk/ntddmou.h winsup/w32api/include/ddk/ntddndis.h winsup/w32api/include/ddk/ntddpar.h winsup/w32api/include/ddk/ntddpcm.h winsup/w32api/include/ddk/ntddscsi.h winsup/w32api/include/ddk/ntddser.h winsup/w32api/include/ddk/ntddstor.h winsup/w32api/include/ddk/ntddtape.h winsup/w32api/include/ddk/ntddtdi.h winsup/w32api/include/ddk/ntddvdeo.h winsup/w32api/include/ddk/ntddvol.h winsup/w32api/include/ddk/ntifs.h winsup/w32api/include/ddk/ntpoapi.h winsup/w32api/include/ddk/ntstatus.h winsup/w32api/include/ddk/parallel.h winsup/w32api/include/ddk/pfhook.h winsup/w32api/include/ddk/poclass.h winsup/w32api/include/ddk/scsi.h winsup/w32api/include/ddk/scsiscan.h winsup/w32api/include/ddk/scsiwmi.h winsup/w32api/include/ddk/smbus.h winsup/w32api/include/ddk/srb.h winsup/w32api/include/ddk/storport.h winsup/w32api/include/ddk/tdi.h winsup/w32api/include/ddk/tdiinfo.h winsup/w32api/include/ddk/tdikrnl.h winsup/w32api/include/ddk/tdistat.h winsup/w32api/include/ddk/tvout.h winsup/w32api/include/ddk/upssvc.h winsup/w32api/include/ddk/usb.h winsup/w32api/include/ddk/usb100.h winsup/w32api/include/ddk/usbcamdi.h winsup/w32api/include/ddk/usbdi.h winsup/w32api/include/ddk/usbioctl.h winsup/w32api/include/ddk/usbiodef.h winsup/w32api/include/ddk/usbscan.h winsup/w32api/include/ddk/usbuser.h winsup/w32api/include/ddk/video.h winsup/w32api/include/ddk/videoagp.h winsup/w32api/include/ddk/win2k.h winsup/w32api/include/ddk/winddi.h winsup/w32api/include/ddk/winddk.h winsup/w32api/include/ddk/winnt4.h winsup/w32api/include/ddk/winxp.h winsup/w32api/include/ddk/ws2san.h winsup/w32api/include/ddk/xfilter.h winsup/w32api/include/dhcpcsdk.h winsup/w32api/include/directx/d3d9.h winsup/w32api/include/directx/d3d9caps.h winsup/w32api/include/directx/d3d9types.h winsup/w32api/include/directx/dxerr8.h winsup/w32api/include/directx/dxerr9.h winsup/w32api/include/dlgs.h winsup/w32api/include/docobj.h winsup/w32api/include/errorrep.h winsup/w32api/include/exdisp.h winsup/w32api/include/exdispid.h winsup/w32api/include/httpext.h winsup/w32api/include/idispids.h winsup/w32api/include/imagehlp.h winsup/w32api/include/imm.h winsup/w32api/include/initguid.h winsup/w32api/include/intshcut.h winsup/w32api/include/ipexport.h winsup/w32api/include/iphlpapi.h winsup/w32api/include/ipifcons.h winsup/w32api/include/iprtrmib.h winsup/w32api/include/iptypes.h winsup/w32api/include/isguids.h winsup/w32api/include/largeint.h winsup/w32api/include/lm.h winsup/w32api/include/lmaccess.h winsup/w32api/include/lmalert.h winsup/w32api/include/lmapibuf.h winsup/w32api/include/lmat.h winsup/w32api/include/lmaudit.h winsup/w32api/include/lmbrowsr.h winsup/w32api/include/lmchdev.h winsup/w32api/include/lmconfig.h winsup/w32api/include/lmcons.h winsup/w32api/include/lmerr.h winsup/w32api/include/lmerrlog.h winsup/w32api/include/lmmsg.h winsup/w32api/include/lmremutl.h winsup/w32api/include/lmrepl.h winsup/w32api/include/lmserver.h winsup/w32api/include/lmshare.h winsup/w32api/include/lmsname.h winsup/w32api/include/lmstats.h winsup/w32api/include/lmsvc.h winsup/w32api/include/lmuse.h winsup/w32api/include/lmuseflg.h winsup/w32api/include/lmwksta.h winsup/w32api/include/lzexpand.h winsup/w32api/include/mapi.h winsup/w32api/include/mciavi.h winsup/w32api/include/mcx.h winsup/w32api/include/mgmtapi.h winsup/w32api/include/mmsystem.h winsup/w32api/include/msacm.h winsup/w32api/include/mshtml.h winsup/w32api/include/mswsock.h winsup/w32api/include/nb30.h winsup/w32api/include/nddeapi.h winsup/w32api/include/nspapi.h winsup/w32api/include/ntdef.h winsup/w32api/include/ntdll.h winsup/w32api/include/ntldap.h winsup/w32api/include/ntsecapi.h winsup/w32api/include/ntsecpkg.h winsup/w32api/include/oaidl.h winsup/w32api/include/objbase.h winsup/w32api/include/objfwd.h winsup/w32api/include/objidl.h winsup/w32api/include/objsafe.h winsup/w32api/include/ocidl.h winsup/w32api/include/odbcinst.h winsup/w32api/include/ole.h winsup/w32api/include/ole2.h winsup/w32api/include/ole2ver.h winsup/w32api/include/oleacc.h winsup/w32api/include/oleauto.h winsup/w32api/include/olectl.h winsup/w32api/include/olectlid.h winsup/w32api/include/oledlg.h winsup/w32api/include/oleidl.h winsup/w32api/include/pbt.h winsup/w32api/include/poppack.h winsup/w32api/include/powrprof.h winsup/w32api/include/prsht.h winsup/w32api/include/psapi.h winsup/w32api/include/pshpack1.h winsup/w32api/include/pshpack2.h winsup/w32api/include/pshpack4.h winsup/w32api/include/pshpack8.h winsup/w32api/include/rapi.h winsup/w32api/include/ras.h winsup/w32api/include/rasdlg.h winsup/w32api/include/raserror.h winsup/w32api/include/rassapi.h winsup/w32api/include/reason.h winsup/w32api/include/regstr.h winsup/w32api/include/richedit.h winsup/w32api/include/richole.h winsup/w32api/include/rpc.h winsup/w32api/include/rpcdce.h winsup/w32api/include/rpcdce2.h winsup/w32api/include/rpcdcep.h winsup/w32api/include/rpcndr.h winsup/w32api/include/rpcnsi.h winsup/w32api/include/rpcnsip.h winsup/w32api/include/rpcnterr.h winsup/w32api/include/rpcproxy.h winsup/w32api/include/schannel.h winsup/w32api/include/schnlsp.h winsup/w32api/include/scrnsave.h winsup/w32api/include/sddl.h winsup/w32api/include/secext.h winsup/w32api/include/security.h winsup/w32api/include/servprov.h winsup/w32api/include/setupapi.h winsup/w32api/include/shellapi.h winsup/w32api/include/shldisp.h winsup/w32api/include/shlguid.h winsup/w32api/include/shlobj.h winsup/w32api/include/shlwapi.h winsup/w32api/include/snmp.h winsup/w32api/include/sql.h winsup/w32api/include/sqlext.h winsup/w32api/include/sqltypes.h winsup/w32api/include/sqlucode.h winsup/w32api/include/sspi.h winsup/w32api/include/subauth.h winsup/w32api/include/svcguid.h winsup/w32api/include/tlhelp32.h winsup/w32api/include/tmschema.h winsup/w32api/include/unknwn.h winsup/w32api/include/userenv.h winsup/w32api/include/uxtheme.h winsup/w32api/include/vfw.h winsup/w32api/include/w32api.h winsup/w32api/include/winable.h winsup/w32api/include/winbase.h winsup/w32api/include/winber.h winsup/w32api/include/wincon.h winsup/w32api/include/wincrypt.h winsup/w32api/include/windef.h winsup/w32api/include/windns.h winsup/w32api/include/windows.h winsup/w32api/include/windowsx.h winsup/w32api/include/winerror.h winsup/w32api/include/wingdi.h winsup/w32api/include/wininet.h winsup/w32api/include/winioctl.h winsup/w32api/include/winldap.h winsup/w32api/include/winnetwk.h winsup/w32api/include/winnls.h winsup/w32api/include/winnt.h winsup/w32api/include/winperf.h winsup/w32api/include/winreg.h winsup/w32api/include/winresrc.h winsup/w32api/include/winsnmp.h winsup/w32api/include/winsock.h winsup/w32api/include/winsock2.h winsup/w32api/include/winspool.h winsup/w32api/include/winsvc.h winsup/w32api/include/winuser.h winsup/w32api/include/winver.h winsup/w32api/include/ws2spi.h winsup/w32api/include/ws2tcpip.h winsup/w32api/include/wsahelp.h winsup/w32api/include/wsipx.h winsup/w32api/include/wsnetbs.h winsup/w32api/include/wtypes.h winsup/w32api/include/zmouse.h winsup/w32api/install-sh winsup/w32api/lib/Makefile.in winsup/w32api/lib/aclui.def winsup/w32api/lib/advapi32.def winsup/w32api/lib/avicap32.def winsup/w32api/lib/avifil32.def winsup/w32api/lib/cap.def winsup/w32api/lib/comctl32.def winsup/w32api/lib/comdlg32.def winsup/w32api/lib/crypt32.def winsup/w32api/lib/ctl3d32.def winsup/w32api/lib/ddk/Makefile.in winsup/w32api/lib/ddk/apcups.def winsup/w32api/lib/ddk/cfgmgr32.def winsup/w32api/lib/ddk/dxapi.def winsup/w32api/lib/ddk/hal.def winsup/w32api/lib/ddk/hid.def winsup/w32api/lib/ddk/hidparse.def winsup/w32api/lib/ddk/mcd.def winsup/w32api/lib/ddk/ndis.def winsup/w32api/lib/ddk/newdev.def winsup/w32api/lib/ddk/ntoskrnl.def winsup/w32api/lib/ddk/scsiport.def winsup/w32api/lib/ddk/tdi.def winsup/w32api/lib/ddk/usbcamd.def winsup/w32api/lib/ddk/usbcamd2.def winsup/w32api/lib/ddk/videoprt.def winsup/w32api/lib/ddk/win32k.def winsup/w32api/lib/dhcpcsvc.def winsup/w32api/lib/directx/Makefile.in winsup/w32api/lib/directx/d3d8.def winsup/w32api/lib/directx/d3d9.def winsup/w32api/lib/directx/d3dim.def winsup/w32api/lib/directx/d3drm.def winsup/w32api/lib/directx/d3dx8d.def winsup/w32api/lib/directx/d3dx9d.def winsup/w32api/lib/directx/d3dxof.def winsup/w32api/lib/directx/ddraw.def winsup/w32api/lib/directx/dinput.def winsup/w32api/lib/directx/dinput8.def winsup/w32api/lib/directx/dinput_joy.c winsup/w32api/lib/directx/dinput_joy2.c winsup/w32api/lib/directx/dinput_kbd.c winsup/w32api/lib/directx/dinput_mouse.c winsup/w32api/lib/directx/dinput_mouse2.c winsup/w32api/lib/directx/dinput_private.h winsup/w32api/lib/directx/dmoguids.c winsup/w32api/lib/directx/dplayx.def winsup/w32api/lib/directx/dpnaddr.def winsup/w32api/lib/directx/dpnet.def winsup/w32api/lib/directx/dpnlobby.def winsup/w32api/lib/directx/dpvoice.def winsup/w32api/lib/directx/dsetup.def winsup/w32api/lib/directx/dsound.def winsup/w32api/lib/directx/dxerr.c winsup/w32api/lib/directx/dxerr8.c winsup/w32api/lib/directx/dxerr8w.c winsup/w32api/lib/directx/dxerr9.c winsup/w32api/lib/directx/dxerr9w.c winsup/w32api/lib/directx/dxguid.c winsup/w32api/lib/directx/ksproxy.def winsup/w32api/lib/directx/ksuser.c winsup/w32api/lib/directx/ksuser.def winsup/w32api/lib/directx/msdmo.def winsup/w32api/lib/directx/quartz.def winsup/w32api/lib/directx/strmiids.c winsup/w32api/lib/directx/test.c winsup/w32api/lib/dlcapi.def winsup/w32api/lib/dnsapi.def winsup/w32api/lib/faultrep.def winsup/w32api/lib/gdi32.def winsup/w32api/lib/glaux.def winsup/w32api/lib/glu32.def winsup/w32api/lib/glut.def winsup/w32api/lib/glut32.def winsup/w32api/lib/igmpagnt.def winsup/w32api/lib/imagehlp.def winsup/w32api/lib/imm32.def winsup/w32api/lib/iphlpapi.def winsup/w32api/lib/kernel32.c winsup/w32api/lib/kernel32.def winsup/w32api/lib/largeint.c winsup/w32api/lib/lz32.def winsup/w32api/lib/mapi32.def winsup/w32api/lib/mfcuia32.def winsup/w32api/lib/mgmtapi.def winsup/w32api/lib/mpr.def winsup/w32api/lib/msacm32.def winsup/w32api/lib/mshtml-uuid.c winsup/w32api/lib/msimg32.def winsup/w32api/lib/msvcp60.def winsup/w32api/lib/msvfw32.def winsup/w32api/lib/mswsock.def winsup/w32api/lib/msxml-uuid.c winsup/w32api/lib/nddeapi.def winsup/w32api/lib/netapi32.def winsup/w32api/lib/ntdll.def winsup/w32api/lib/odbc32.def winsup/w32api/lib/odbccp32.def winsup/w32api/lib/ole32.def winsup/w32api/lib/oleacc.def winsup/w32api/lib/oleaut32.def winsup/w32api/lib/olecli32.def winsup/w32api/lib/oledlg.def winsup/w32api/lib/olepro32.def winsup/w32api/lib/olesvr32.def winsup/w32api/lib/opengl32.def winsup/w32api/lib/penwin32.def winsup/w32api/lib/pkpd32.def winsup/w32api/lib/powrprof.def winsup/w32api/lib/psapi.def winsup/w32api/lib/rapi.def winsup/w32api/lib/rasapi32.def winsup/w32api/lib/rasdlg.def winsup/w32api/lib/res.rc winsup/w32api/lib/rpcdce4.def winsup/w32api/lib/rpcns4.def winsup/w32api/lib/rpcrt4.def winsup/w32api/lib/scrnsave.c winsup/w32api/lib/secur32.def winsup/w32api/lib/setupapi.def winsup/w32api/lib/shell32.c winsup/w32api/lib/shell32.def winsup/w32api/lib/shfolder.def winsup/w32api/lib/shlwapi.def winsup/w32api/lib/snmpapi.def winsup/w32api/lib/svrapi.def winsup/w32api/lib/tapi32.def winsup/w32api/lib/test.c winsup/w32api/lib/th32.def winsup/w32api/lib/thunk32.def winsup/w32api/lib/url.def winsup/w32api/lib/user32.def winsup/w32api/lib/userenv.def winsup/w32api/lib/uuid.c winsup/w32api/lib/uxtheme.def winsup/w32api/lib/vdmdbg.def winsup/w32api/lib/version.def winsup/w32api/lib/vfw32.mri winsup/w32api/lib/win32spl.def winsup/w32api/lib/wininet.def winsup/w32api/lib/winmm.def winsup/w32api/lib/winspool.def winsup/w32api/lib/winstrm.def winsup/w32api/lib/wldap32.def winsup/w32api/lib/wow32.def winsup/w32api/lib/ws2_32.c winsup/w32api/lib/ws2_32.def winsup/w32api/lib/wsnmp32.def winsup/w32api/lib/wsock32.def winsup/w32api/lib/wst.def winsup/w32api/lib/wtsapi32.def
Diffstat (limited to 'winsup/cygwin/mmap.cc')
-rw-r--r--winsup/cygwin/mmap.cc2022
1 files changed, 0 insertions, 2022 deletions
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
deleted file mode 100644
index e58405594..000000000
--- a/winsup/cygwin/mmap.cc
+++ /dev/null
@@ -1,2022 +0,0 @@
-/* mmap.cc
-
- Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#include "winsup.h"
-#include <unistd.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <sys/mman.h>
-#include <sys/param.h>
-#include "cygerrno.h"
-#include "security.h"
-#include "path.h"
-#include "fhandler.h"
-#include "dtable.h"
-#include "cygheap.h"
-#include "pinfo.h"
-#include "sys/cygwin.h"
-#include "ntdll.h"
-
-/* __PROT_ATTACH indicates an anonymous mapping which is supposed to be
- attached to a file mapping for pages beyond the file's EOF. The idea
- is to support mappings longer than the file, without the file growing
- to mapping length (POSIX semantics). */
-#define __PROT_ATTACH 0x8000000
-/* Filler pages are the pages from the last file backed page to the next
- 64K boundary. These pages are created as anonymous pages, but with
- the same page protection as the file's pages, since POSIX applications
- expect to be able to access this part the same way as the file pages. */
-#define __PROT_FILLER 0x4000000
-
-#define PAGE_CNT(bytes) howmany((bytes),getpagesize())
-
-#define PGBITS (sizeof (DWORD)*8)
-#define MAPSIZE(pages) howmany ((pages), PGBITS)
-
-#define MAP_SET(n) (page_map[(n)/PGBITS] |= (1L << ((n) % PGBITS)))
-#define MAP_CLR(n) (page_map[(n)/PGBITS] &= ~(1L << ((n) % PGBITS)))
-#define MAP_ISSET(n) (page_map[(n)/PGBITS] & (1L << ((n) % PGBITS)))
-
-/* Used for anonymous mappings. */
-static fhandler_dev_zero fh_anonymous;
-/* Used for reopening a disk file when necessary. */
-static fhandler_disk_file fh_disk_file;
-
-/* Small helpers to avoid having lots of flag bit tests in the code. */
-static inline bool
-priv (int flags)
-{
- return (flags & MAP_PRIVATE) == MAP_PRIVATE;
-}
-
-static inline bool
-fixed (int flags)
-{
- return (flags & MAP_FIXED) == MAP_FIXED;
-}
-
-static inline bool
-anonymous (int flags)
-{
- return (flags & MAP_ANONYMOUS) == MAP_ANONYMOUS;
-}
-
-static inline bool
-noreserve (int flags)
-{
- return (flags & MAP_NORESERVE) == MAP_NORESERVE;
-}
-
-static inline bool
-autogrow (int flags)
-{
- return (flags & MAP_AUTOGROW) == MAP_AUTOGROW;
-}
-
-static inline bool
-attached (int prot)
-{
- return (prot & __PROT_ATTACH) == __PROT_ATTACH;
-}
-
-static inline bool
-filler (int prot)
-{
- return (prot & __PROT_FILLER) == __PROT_FILLER;
-}
-
-static inline DWORD
-gen_create_protect (DWORD openflags, int flags)
-{
- DWORD ret = PAGE_READONLY;
-
- if (priv (flags))
- ret = PAGE_WRITECOPY;
- else if (openflags & GENERIC_WRITE)
- ret = PAGE_READWRITE;
-
- /* Ignore EXECUTE permission on 9x. */
- if ((openflags & GENERIC_EXECUTE)
- && wincap.virtual_protect_works_on_shared_pages ())
- ret <<= 4;
-
- return ret;
-}
-
-/* Generate Windows protection flags from mmap prot and flag values. */
-static inline DWORD
-gen_protect (int prot, int flags)
-{
- DWORD ret = PAGE_NOACCESS;
-
- /* Attached pages are only reserved, but the protection must be a
- valid value, so we just return PAGE_READWRITE. */
- if (attached (prot))
- return PAGE_EXECUTE_READWRITE;
-
- if (prot & PROT_WRITE)
- ret = (priv (flags) && (!anonymous (flags) || filler (prot)))
- ? PAGE_WRITECOPY : PAGE_READWRITE;
- else if (prot & PROT_READ)
- ret = PAGE_READONLY;
-
- /* Ignore EXECUTE permission on 9x. */
- if ((prot & PROT_EXEC)
- && wincap.virtual_protect_works_on_shared_pages ())
- ret <<= 4;
-
- return ret;
-}
-
-/* Generate Windows access flags from mmap prot and flag values.
- Only used on 9x. PROT_EXEC not supported here since it's not
- necessary. */
-static inline DWORD
-gen_access (DWORD openflags, int flags)
-{
- DWORD ret = FILE_MAP_READ;
- if (priv (flags))
- ret = FILE_MAP_COPY;
- else if (openflags & GENERIC_WRITE)
- ret = priv (flags) ? FILE_MAP_COPY : FILE_MAP_WRITE;
- return ret;
-}
-
-/* OS specific wrapper functions for map/section functions. */
-static BOOL
-VirtualProt9x (PVOID addr, SIZE_T len, DWORD prot, PDWORD oldprot)
-{
- if (addr >= (caddr_t)0x80000000 && addr <= (caddr_t)0xBFFFFFFF)
- return TRUE; /* FAKEALARM! */
- return VirtualProtect (addr, len, prot, oldprot);
-}
-
-static BOOL
-VirtualProtNT (PVOID addr, SIZE_T len, DWORD prot, PDWORD oldprot)
-{
- return VirtualProtect (addr, len, prot, oldprot);
-}
-
-static BOOL
-VirtualProtEx9x (HANDLE parent, PVOID addr, SIZE_T len, DWORD prot,
- PDWORD oldprot)
-{
- if (addr >= (caddr_t)0x80000000 && addr <= (caddr_t)0xBFFFFFFF)
- return TRUE; /* FAKEALARM! */
- return VirtualProtectEx (parent, addr, len, prot, oldprot);
-}
-static BOOL
-VirtualProtExNT (HANDLE parent, PVOID addr, SIZE_T len, DWORD prot,
- PDWORD oldprot)
-{
- return VirtualProtectEx (parent, addr, len, prot, oldprot);
-}
-
-/* This allows to stay lazy about VirtualProtect usage in subsequent code. */
-#define VirtualProtect(a,l,p,o) (mmap_func->VirtualProt((a),(l),(p),(o)))
-#define VirtualProtectEx(h,a,l,p,o) (mmap_func->VirtualProtEx((h),(a),(l),(p),(o)))
-
-static HANDLE
-CreateMapping9x (HANDLE fhdl, size_t len, _off64_t off, DWORD openflags,
- int prot, int flags, const char *name)
-{
- HANDLE h;
- DWORD high, low;
-
- DWORD protect = gen_create_protect (openflags, flags);
-
- /* copy-on-write doesn't work properly on 9x with real files. While the
- changes are not propagated to the file, they are visible to other
- processes sharing the same file mapping object. Workaround: Don't
- use named file mapping. That should work since sharing file
- mappings only works reliable using named file mapping on 9x.
-
- On 9x/ME try first to open the mapping by name when opening a
- shared file object. This is needed since 9x/ME only shares objects
- between processes by name. What a mess... */
-
- if (fhdl != INVALID_HANDLE_VALUE && !priv (flags))
- {
- /* Grrr, the whole stuff is just needed to try to get a reliable
- mapping of the same file. Even that uprising isn't bullet
- proof but it does it's best... */
- char namebuf[CYG_MAX_PATH];
- cygwin_conv_to_full_posix_path (name, namebuf);
- for (int i = strlen (namebuf) - 1; i >= 0; --i)
- namebuf[i] = cyg_tolower (namebuf [i]);
-
- debug_printf ("named sharing");
- DWORD access = gen_access (openflags, flags);
- /* Different access modes result in incompatible mappings. So we
- create different maps per access mode by using different names. */
- switch (access)
- {
- case FILE_MAP_READ:
- namebuf[0] = 'R';
- break;
- case FILE_MAP_WRITE:
- namebuf[0] = 'W';
- break;
- case FILE_MAP_COPY:
- namebuf[0] = 'C';
- break;
- }
- if (!(h = OpenFileMapping (access, TRUE, namebuf)))
- h = CreateFileMapping (fhdl, &sec_none, protect, 0, 0, namebuf);
- }
- else if (fhdl == INVALID_HANDLE_VALUE)
- {
- /* Standard anonymous mapping needs non-zero len. */
- h = CreateFileMapping (fhdl, &sec_none, protect, 0, len, NULL);
- }
- else if (autogrow (flags))
- {
- high = (off + len) >> 32;
- low = (off + len) & UINT32_MAX;
- /* Auto-grow only works if the protection is PAGE_READWRITE. So,
- first we call CreateFileMapping with PAGE_READWRITE, then, if the
- requested protection is different, we close the mapping and
- reopen it again with the correct protection, if auto-grow worked. */
- h = CreateFileMapping (fhdl, &sec_none, PAGE_READWRITE,
- high, low, NULL);
- if (h && protect != PAGE_READWRITE)
- {
- CloseHandle (h);
- h = CreateFileMapping (fhdl, &sec_none, protect,
- high, low, NULL);
- }
- }
- else
- {
- /* Zero len creates mapping for whole file. */
- h = CreateFileMapping (fhdl, &sec_none, protect, 0, 0, NULL);
- }
- return h;
-}
-
-static HANDLE
-CreateMappingNT (HANDLE fhdl, size_t len, _off64_t off, DWORD openflags,
- int prot, int flags, const char *)
-{
- HANDLE h;
- NTSTATUS ret;
-
- LARGE_INTEGER sectionsize = { QuadPart: len };
- ULONG protect = gen_create_protect (openflags, flags);
- ULONG attributes = attached (prot) ? SEC_RESERVE : SEC_COMMIT;
-
- OBJECT_ATTRIBUTES oa;
- InitializeObjectAttributes (&oa, NULL, OBJ_INHERIT, NULL,
- sec_none.lpSecurityDescriptor);
-
- if (fhdl == INVALID_HANDLE_VALUE)
- {
- /* Standard anonymous mapping needs non-zero len. */
- ret = NtCreateSection (&h, SECTION_ALL_ACCESS, &oa,
- &sectionsize, protect, attributes, NULL);
- }
- else if (autogrow (flags))
- {
- /* Auto-grow only works if the protection is PAGE_READWRITE. So,
- first we call NtCreateSection with PAGE_READWRITE, then, if the
- requested protection is different, we close the mapping and
- reopen it again with the correct protection, if auto-grow worked. */
- sectionsize.QuadPart += off;
- ret = NtCreateSection (&h, SECTION_ALL_ACCESS, &oa,
- &sectionsize, PAGE_READWRITE, attributes, fhdl);
- if (NT_SUCCESS (ret) && protect != PAGE_READWRITE)
- {
- CloseHandle (h);
- ret = NtCreateSection (&h, SECTION_ALL_ACCESS, &oa,
- &sectionsize, protect, attributes, fhdl);
- }
- }
- else
- {
- /* Zero len creates mapping for whole file and allows
- AT_EXTENDABLE_FILE mapping, if we ever use it... */
- sectionsize.QuadPart = 0;
- ret = NtCreateSection (&h, SECTION_ALL_ACCESS, &oa,
- &sectionsize, protect, attributes, fhdl);
- }
- if (!NT_SUCCESS (ret))
- {
- h = NULL;
- SetLastError (RtlNtStatusToDosError (ret));
- }
- return h;
-}
-
-void *
-MapView9x (HANDLE h, void *addr, size_t len, DWORD openflags,
- int prot, int flags, _off64_t off)
-{
- DWORD high = off >> 32;
- DWORD low = off & UINT32_MAX;
- DWORD access = gen_access (openflags, flags);
- void *base;
-
- /* Try mapping using the given address first, even if it's NULL.
- If it failed, and addr was not NULL and flags is not MAP_FIXED,
- try again with NULL address. */
- if (!addr)
- base = MapViewOfFile (h, access, high, low, len);
- else
- {
- base = MapViewOfFileEx (h, access, high, low, len, addr);
- if (!base && !fixed (flags))
- base = MapViewOfFile (h, access, high, low, len);
- }
- debug_printf ("%x = MapViewOfFileEx (h:%x, access:%x, 0, off:%D, "
- "len:%u, addr:%x)", base, h, access, off, len, addr);
- return base;
-}
-
-void *
-MapViewNT (HANDLE h, void *addr, size_t len, DWORD openflags,
- int prot, int flags, _off64_t off)
-{
- NTSTATUS ret;
- LARGE_INTEGER offset = { QuadPart:off };
- DWORD protect = gen_create_protect (openflags, flags);
- void *base = addr;
- ULONG commitsize = attached (prot) ? 0 : len;
- ULONG viewsize = len;
- ULONG alloc_type = base && !wincap.is_wow64 () ? AT_ROUND_TO_PAGE : 0;
-
- /* Try mapping using the given address first, even if it's NULL.
- If it failed, and addr was not NULL and flags is not MAP_FIXED,
- try again with NULL address. */
- ret = NtMapViewOfSection (h, GetCurrentProcess (), &base, 0, commitsize,
- &offset, &viewsize, ViewShare, alloc_type, protect);
- if (!NT_SUCCESS (ret) && addr && !fixed (flags))
- {
- base = NULL;
- ret = NtMapViewOfSection (h, GetCurrentProcess (), &base, 0, commitsize,
- &offset, &viewsize, ViewShare, 0, protect);
- }
- if (!NT_SUCCESS (ret))
- {
- base = NULL;
- SetLastError (RtlNtStatusToDosError (ret));
- }
- debug_printf ("%x = NtMapViewOfSection (h:%x, addr:%x, len:%u, off:%D, "
- "protect:%x, type:%x)", base, h, addr, len, off, protect, 0);
- return base;
-}
-
-struct mmap_func_t
-{
- HANDLE (*CreateMapping)(HANDLE, size_t, _off64_t, DWORD, int, int,
- const char *);
- void * (*MapView)(HANDLE, void *, size_t, DWORD, int, int, _off64_t);
- BOOL (*VirtualProt)(PVOID, SIZE_T, DWORD, PDWORD);
- BOOL (*VirtualProtEx)(HANDLE, PVOID, SIZE_T, DWORD, PDWORD);
-};
-
-mmap_func_t mmap_funcs_9x =
-{
- CreateMapping9x,
- MapView9x,
- VirtualProt9x,
- VirtualProtEx9x
-};
-
-mmap_func_t mmap_funcs_nt =
-{
- CreateMappingNT,
- MapViewNT,
- VirtualProtNT,
- VirtualProtExNT
-};
-
-mmap_func_t *mmap_func;
-
-void
-mmap_init ()
-{
- mmap_func = wincap.is_winnt () ? &mmap_funcs_nt : &mmap_funcs_9x;
-}
-
-/* Class structure used to keep a record of all current mmap areas
- in a process. Needed for bookkeeping all mmaps in a process and
- for duplicating all mmaps after fork() since mmaps are not propagated
- to child processes by Windows. All information must be duplicated
- by hand, see fixup_mmaps_after_fork().
-
- The class structure:
-
- One member of class map per process, global variable mmapped_areas.
- Contains a dynamic class list array. Each list entry represents all
- mapping to a file, keyed by file descriptor and file name hash.
- Each list entry contains a dynamic class mmap_record array. Each
- mmap_record represents exactly one mapping. For each mapping, there's
- an additional so called `page_map'. It's an array of bits, one bit
- per mapped memory page. The bit is set if the page is accessible,
- unset otherwise. */
-
-class mmap_record
-{
- private:
- int fd;
- HANDLE mapping_hdl;
- DWORD openflags;
- int prot;
- int flags;
- _off64_t offset;
- DWORD len;
- caddr_t base_address;
- DWORD *page_map;
- device dev;
-
- public:
- mmap_record (int nfd, HANDLE h, DWORD of, int p, int f, _off64_t o, DWORD l,
- caddr_t b) :
- fd (nfd),
- mapping_hdl (h),
- openflags (of),
- prot (p),
- flags (f),
- offset (o),
- len (l),
- base_address (b),
- page_map (NULL)
- {
- dev.devn = 0;
- if (fd >= 0 && !cygheap->fdtab.not_open (fd))
- dev = cygheap->fdtab[fd]->dev ();
- else if (fd == -1)
- dev.parse (FH_ZERO);
- }
-
- int get_fd () const { return fd; }
- HANDLE get_handle () const { return mapping_hdl; }
- device& get_device () { return dev; }
- int get_prot () const { return prot; }
- int get_openflags () const { return openflags; }
- int get_flags () const { return flags; }
- bool priv () const { return ::priv (flags); }
- bool fixed () const { return ::fixed (flags); }
- bool anonymous () const { return ::anonymous (flags); }
- bool noreserve () const { return ::noreserve (flags); }
- bool autogrow () const { return ::autogrow (flags); }
- bool attached () const { return ::attached (prot); }
- bool filler () const { return ::filler (prot); }
- _off64_t get_offset () const { return offset; }
- DWORD get_len () const { return len; }
- caddr_t get_address () const { return base_address; }
-
- bool alloc_page_map ();
- void free_page_map () { if (page_map) cfree (page_map); }
-
- DWORD find_unused_pages (DWORD pages) const;
- _off64_t map_pages (_off64_t off, DWORD len);
- bool map_pages (caddr_t addr, DWORD len);
- bool unmap_pages (caddr_t addr, DWORD len);
- int access (caddr_t address);
-
- fhandler_base *alloc_fh ();
- void free_fh (fhandler_base *fh);
-
- DWORD gen_create_protect () const
- { return ::gen_create_protect (get_openflags (), get_flags ()); }
- DWORD gen_protect () const
- { return ::gen_protect (get_prot (), get_flags ()); }
- DWORD gen_access () const
- { return ::gen_access (get_openflags (), get_flags ()); }
- bool compatible_flags (int fl) const;
-};
-
-class list
-{
- private:
- mmap_record *recs;
- int nrecs, maxrecs;
- int fd;
- DWORD hash;
-
- public:
- int get_fd () const { return fd; }
- DWORD get_hash () const { return hash; }
- mmap_record *get_record (int i) { return i >= nrecs ? NULL : recs + i; }
-
- bool anonymous () const { return fd == -1; }
- void set (int nfd);
- mmap_record *add_record (mmap_record r);
- bool del_record (int i);
- void free_recs () { if (recs) cfree (recs); }
- mmap_record *search_record (_off64_t off, DWORD len);
- long search_record (caddr_t addr, DWORD len, caddr_t &m_addr, DWORD &m_len,
- long start);
- caddr_t try_map (void *addr, size_t len, int flags, _off64_t off);
-};
-
-class map
-{
- private:
- list *lists;
- unsigned nlists, maxlists;
-
- public:
- list *get_list (unsigned i) { return i >= nlists ? NULL : lists + i; }
- list *get_list_by_fd (int fd);
- list *add_list (int fd);
- void del_list (unsigned i);
-};
-
-/* This is the global map structure pointer. */
-static map mmapped_areas;
-
-bool
-mmap_record::compatible_flags (int fl) const
-{
-#define MAP_COMPATMASK (MAP_TYPE | MAP_NORESERVE)
- return (get_flags () & MAP_COMPATMASK) == (fl & MAP_COMPATMASK);
-}
-
-DWORD
-mmap_record::find_unused_pages (DWORD pages) const
-{
- DWORD mapped_pages = PAGE_CNT (get_len ());
- DWORD start;
-
- if (pages > mapped_pages)
- return (DWORD)-1;
- for (start = 0; start <= mapped_pages - pages; ++start)
- if (!MAP_ISSET (start))
- {
- DWORD cnt;
- for (cnt = 0; cnt < pages; ++cnt)
- if (MAP_ISSET (start + cnt))
- break;
- if (cnt >= pages)
- return start;
- }
- return (DWORD)-1;
-}
-
-bool
-mmap_record::alloc_page_map ()
-{
- /* Allocate one bit per page */
- if (!(page_map = (DWORD *) ccalloc (HEAP_MMAP,
- MAPSIZE (PAGE_CNT (get_len ())),
- sizeof (DWORD))))
- return false;
-
- DWORD start_protect = gen_create_protect ();
- DWORD real_protect = gen_protect ();
- if (real_protect != start_protect
- && !VirtualProtect (get_address (), get_len (),
- real_protect, &start_protect))
- system_printf ("Warning: VirtualProtect (addr: %p, len: 0x%x, "
- "new_prot: 0x%x, old_prot: 0x%x), %E",
- get_address (), get_len (),
- real_protect, start_protect);
- DWORD len = PAGE_CNT (get_len ());
- while (len-- > 0)
- MAP_SET (len);
- return true;
-}
-
-_off64_t
-mmap_record::map_pages (_off64_t off, DWORD len)
-{
- /* Used ONLY if this mapping matches into the chunk of another already
- performed mapping in a special case of MAP_ANON|MAP_PRIVATE.
-
- Otherwise it's job is now done by alloc_page_map(). */
- DWORD old_prot;
- debug_printf ("map_pages (fd=%d, off=%D, len=%u)", get_fd (), off, len);
- len = PAGE_CNT (len);
-
- if ((off = find_unused_pages (len)) == (DWORD)-1)
- return 0L;
- if (!noreserve ()
- && !VirtualProtect (get_address () + off * getpagesize (),
- len * getpagesize (), gen_protect (), &old_prot))
- {
- __seterrno ();
- return (_off64_t)-1;
- }
-
- while (len-- > 0)
- MAP_SET (off + len);
- return off * getpagesize ();
-}
-
-bool
-mmap_record::map_pages (caddr_t addr, DWORD len)
-{
- debug_printf ("map_pages (addr=%x, len=%u)", addr, len);
- DWORD old_prot;
- DWORD off = addr - get_address ();
- off /= getpagesize ();
- len = PAGE_CNT (len);
- /* First check if the area is unused right now. */
- for (DWORD l = 0; l < len; ++l)
- if (MAP_ISSET (off + l))
- {
- set_errno (EINVAL);
- return false;
- }
- if (!noreserve ()
- && !VirtualProtect (get_address () + off * getpagesize (),
- len * getpagesize (), gen_protect (), &old_prot))
- {
- __seterrno ();
- return false;
- }
- for (; len-- > 0; ++off)
- MAP_SET (off);
- return true;
-}
-
-bool
-mmap_record::unmap_pages (caddr_t addr, DWORD len)
-{
- DWORD old_prot;
- DWORD off = addr - get_address ();
- off /= getpagesize ();
- len = PAGE_CNT (len);
- if (anonymous () && priv () && noreserve ()
- && !VirtualFree (get_address () + off * getpagesize (),
- len * getpagesize (), MEM_DECOMMIT))
- debug_printf ("VirtualFree in unmap_pages () failed, %E");
- else if (!VirtualProtect (get_address () + off * getpagesize (),
- len * getpagesize (), PAGE_NOACCESS, &old_prot))
- debug_printf ("VirtualProtect in unmap_pages () failed, %E");
-
- for (; len-- > 0; ++off)
- MAP_CLR (off);
- /* Return TRUE if all pages are free'd which may result in unmapping
- the whole chunk. */
- for (len = MAPSIZE (PAGE_CNT (get_len ())); len > 0; )
- if (page_map[--len])
- return false;
- return true;
-}
-
-int
-mmap_record::access (caddr_t address)
-{
- if (address < get_address () || address >= get_address () + get_len ())
- return 0;
- DWORD off = (address - get_address ()) / getpagesize ();
- return MAP_ISSET (off);
-}
-
-fhandler_base *
-mmap_record::alloc_fh ()
-{
- if (anonymous ())
- {
- fh_anonymous.set_io_handle (INVALID_HANDLE_VALUE);
- fh_anonymous.set_access (GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE);
- return &fh_anonymous;
- }
-
- /* The file descriptor could have been closed or, even
- worse, could have been reused for another file before
- the call to fork(). This requires creating a fhandler
- of the correct type to be sure to call the method of the
- correct class. */
- fhandler_base *fh = build_fh_dev (get_device ());
- fh->set_access (get_openflags ());
- return fh;
-}
-
-void
-mmap_record::free_fh (fhandler_base *fh)
-{
- if (!anonymous ())
- cfree (fh);
-}
-
-mmap_record *
-list::add_record (mmap_record r)
-{
- if (nrecs == maxrecs)
- {
- mmap_record *new_recs;
- if (maxrecs == 0)
- new_recs = (mmap_record *)
- cmalloc (HEAP_MMAP, 5 * sizeof (mmap_record));
- else
- new_recs = (mmap_record *)
- crealloc (recs, (maxrecs + 5) * sizeof (mmap_record));
- if (!new_recs)
- return NULL;
- maxrecs += 5;
- recs = new_recs;
- }
- recs[nrecs] = r;
- if (!recs[nrecs].alloc_page_map ())
- return NULL;
- return recs + nrecs++;
-}
-
-/* Used in mmap() */
-mmap_record *
-list::search_record (_off64_t off, DWORD len)
-{
- if (anonymous () && !off)
- {
- len = PAGE_CNT (len);
- for (int i = 0; i < nrecs; ++i)
- if (recs[i].find_unused_pages (len) != (DWORD)-1)
- return recs + i;
- }
- else
- {
- for (int i = 0; i < nrecs; ++i)
- if (off >= recs[i].get_offset ()
- && off + len <= recs[i].get_offset ()
- + (PAGE_CNT (recs[i].get_len ()) * getpagesize ()))
- return recs + i;
- }
- return NULL;
-}
-
-/* Used in munmap() */
-long
-list::search_record (caddr_t addr, DWORD len, caddr_t &m_addr, DWORD &m_len,
- long start)
-{
- caddr_t low, high;
-
- for (long i = start + 1; i < nrecs; ++i)
- {
- low = (addr >= recs[i].get_address ()) ? addr : recs[i].get_address ();
- high = recs[i].get_address ();
- if (recs[i].filler ())
- high += recs[i].get_len ();
- else
- high += (PAGE_CNT (recs[i].get_len ()) * getpagesize ());
- high = (addr + len < high) ? addr + len : high;
- if (low < high)
- {
- m_addr = low;
- m_len = high - low;
- return i;
- }
- }
- return -1;
-}
-
-void
-list::set (int nfd)
-{
- fd = nfd;
- if (!anonymous ())
- {
- /* The fd isn't sufficient since it could already be the fd of another
- file. So we use the inode number as evaluated by fstat to identify
- the file. */
- struct stat st;
- fstat (nfd, &st);
- hash = st.st_ino;
- }
- nrecs = maxrecs = 0;
- recs = NULL;
-}
-
-bool
-list::del_record (int i)
-{
- if (i < nrecs)
- {
- recs[i].free_page_map ();
- for (; i < nrecs - 1; i++)
- recs[i] = recs[i + 1];
- nrecs--;
- }
- /* Return true if the list is empty which allows the caller to remove
- this list from the list array. */
- return !nrecs;
-}
-
-caddr_t
-list::try_map (void *addr, size_t len, int flags, _off64_t off)
-{
- mmap_record *rec;
-
- if (off == 0 && !fixed (flags))
- {
- /* If MAP_FIXED isn't given, check if this mapping matches into the
- chunk of another already performed mapping. */
- if ((rec = search_record (off, len)) != NULL
- && rec->compatible_flags (flags))
- {
- if ((off = rec->map_pages (off, len)) == (_off64_t)-1)
- return (caddr_t) MAP_FAILED;
- return (caddr_t) rec->get_address () + off;
- }
- }
- else if (fixed (flags))
- {
- /* If MAP_FIXED is given, test if the requested area is in an
- unmapped part of an still active mapping. This can happen
- if a memory region is unmapped and remapped with MAP_FIXED. */
- caddr_t u_addr;
- DWORD u_len;
- long record_idx = -1;
- if ((record_idx = search_record ((caddr_t) addr, len, u_addr, u_len,
- record_idx)) >= 0)
- {
- rec = get_record (record_idx);
- if (u_addr > (caddr_t) addr || u_addr + len < (caddr_t) addr + len
- || !rec->compatible_flags (flags))
- {
- /* Partial match only, or access mode doesn't match. */
- /* FIXME: Handle partial mappings gracefully if adjacent
- memory is available. */
- set_errno (EINVAL);
- return (caddr_t) MAP_FAILED;
- }
- if (!rec->map_pages ((caddr_t) addr, len))
- return (caddr_t) MAP_FAILED;
- return (caddr_t) addr;
- }
- }
- return NULL;
-}
-
-list *
-map::get_list_by_fd (int fd)
-{
- unsigned i;
- for (i = 0; i < nlists; i++)
- {
- if (fd == -1 && lists[i].anonymous ())
- return lists + i;
- /* The fd isn't sufficient since it could already be the fd of another
- file. So we use the inode number as evaluated by fstat to identify
- the file. */
- struct stat st;
- if (fd != -1 && !fstat (fd, &st) && lists[i].get_hash () == st.st_ino)
- return lists + i;
- }
- return 0;
-}
-
-list *
-map::add_list (int fd)
-{
- if (nlists == maxlists)
- {
- list *new_lists;
- if (maxlists == 0)
- new_lists = (list *) cmalloc (HEAP_MMAP, 5 * sizeof (list));
- else
- new_lists = (list *) crealloc (lists, (maxlists + 5) * sizeof (list));
- if (!new_lists)
- return NULL;
- maxlists += 5;
- lists = new_lists;
- }
- lists[nlists].set (fd);
- return lists + nlists++;
-}
-
-void
-map::del_list (unsigned i)
-{
- if (i < nlists)
- {
- lists[i].free_recs ();
- for (; i < nlists - 1; i++)
- lists[i] = lists[i + 1];
- nlists--;
- }
-}
-
-/* This function is called from exception_handler when a segmentation
- violation has happened. The function should return true, if the
- faulting address (the parameter) is within attached pages. In this
- case the exception_handler raises SIGBUS, as demanded by the memory
- protection extension described in SUSv3 (see the mmap man page).
- If false is returned, a normal SIGSEGV is raised. */
-bool
-mmap_is_attached_page (ULONG_PTR addr)
-{
- list *map_list;
- long record_idx;
- caddr_t u_addr;
- DWORD u_len;
- DWORD pagesize = getsystempagesize ();
-
- addr = rounddown (addr, pagesize);
- if (!(map_list = mmapped_areas.get_list_by_fd (-1)))
- return false;
- if ((record_idx = map_list->search_record ((caddr_t)addr, pagesize,
- u_addr, u_len, -1)) < 0)
- return false;
- if (!map_list->get_record (record_idx)->attached ())
- return false;
- return true;
-}
-
-static caddr_t
-mmap_worker (fhandler_base *fh, caddr_t base, size_t len, int prot, int flags,
- int fd, _off64_t off)
-{
- list *map_list;
- HANDLE h = fh->mmap (&base, len, prot, flags, off);
- if (h == INVALID_HANDLE_VALUE)
- return NULL;
- if (!(map_list = mmapped_areas.get_list_by_fd (fd))
- && !(map_list = mmapped_areas.add_list (fd)))
- {
- fh->munmap (h, base, len);
- return NULL;
- }
- mmap_record mmap_rec (fd, h, fh->get_access (), prot, flags, off, len, base);
- mmap_record *rec = map_list->add_record (mmap_rec);
- if (!rec)
- {
- fh->munmap (h, base, len);
- return NULL;
- }
- return base;
-}
-
-extern "C" void *
-mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off)
-{
- syscall_printf ("addr %x, len %u, prot %x, flags %x, fd %d, off %D",
- addr, len, prot, flags, fd, off);
-
- caddr_t ret = (caddr_t) MAP_FAILED;
- fhandler_base *fh = NULL;
- list *map_list = NULL;
- size_t orig_len = 0;
- caddr_t base = NULL;
-
- DWORD pagesize = getpagesize ();
-
- fh_anonymous.set_io_handle (INVALID_HANDLE_VALUE);
- fh_anonymous.set_access (GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE);
- fh_disk_file.set_io_handle (NULL);
-
- SetResourceLock (LOCK_MMAP_LIST, READ_LOCK | WRITE_LOCK, "mmap");
-
- /* EINVAL error conditions. Note that the addr%pagesize test is deferred
- to workaround a serious alignment problem in Windows 98. */
- if (off % pagesize
- || ((prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)))
- || ((flags & MAP_TYPE) != MAP_SHARED
- && (flags & MAP_TYPE) != MAP_PRIVATE)
-#if 0
- || (fixed (flags) && ((uintptr_t) addr % pagesize))
-#endif
- || !len)
- {
- set_errno (EINVAL);
- goto out;
- }
-
- /* There's a serious alignment problem in Windows 98. MapViewOfFile
- sometimes returns addresses which are page aligned instead of
- granularity aligned. OTOH, it's not possible to force such an
- address using MapViewOfFileEx. So what we do here to let it work
- at least most of the time is, allow 4K aligned addresses in 98,
- to enable remapping of formerly mapped pages. If no matching
- free pages exist, check addr again, this time for the real alignment. */
- DWORD checkpagesize = wincap.has_mmap_alignment_bug () ?
- getsystempagesize () : pagesize;
- if (fixed (flags) && ((uintptr_t) addr % checkpagesize))
- {
- set_errno (EINVAL);
- goto out;
- }
-
- if (!anonymous (flags) && fd != -1)
- {
- /* Ensure that fd is open */
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- goto out;
-
- fh = cfd;
-
- /* mmap /dev/zero is like MAP_ANONYMOUS. */
- if (fh->get_device () == FH_ZERO)
- flags |= MAP_ANONYMOUS;
- }
- if (anonymous (flags) || fd == -1)
- {
- fh = &fh_anonymous;
- fd = -1;
- flags |= MAP_ANONYMOUS;
- /* Anonymous mappings are always forced to pagesize length with
- no offset. */
- len = roundup2 (len, pagesize);
- off = 0;
- }
- else if (fh->get_device () == FH_FS)
- {
- /* EACCES error conditions according to SUSv3. File must be opened
- for reading, regardless of the requested protection, and file must
- be opened for writing when PROT_WRITE together with MAP_SHARED
- is requested. */
- if (!(fh->get_access () & GENERIC_READ)
- || (!(fh->get_access () & GENERIC_WRITE)
- && (prot & PROT_WRITE) && !priv (flags)))
- {
- set_errno (EACCES);
- goto out;
- }
-
- /* On 9x you can't create mappings with PAGE_WRITECOPY protection if
- the file isn't explicitely opened with WRITE access. */
- if (!wincap.is_winnt () && priv (flags)
- && !(fh->get_access () & GENERIC_WRITE))
- {
- HANDLE h = CreateFile (fh->get_win32_name (),
- fh->get_access () | GENERIC_WRITE,
- wincap.shared (), &sec_none_nih,
- OPEN_EXISTING, 0, NULL);
- if (h == INVALID_HANDLE_VALUE)
- {
- set_errno (EACCES);
- goto out;
- }
- fh_disk_file.set_io_handle (h);
- fh_disk_file.set_access (fh->get_access () | GENERIC_WRITE);
- path_conv pc;
- pc.set_name (fh->get_win32_name (), "");
- fh_disk_file.set_name (pc);
- fh = &fh_disk_file;
- }
-
- /* On NT you can't create mappings with PAGE_EXECUTE protection if
- the file isn't explicitely opened with EXECUTE access. */
- if (wincap.is_winnt ())
- {
- HANDLE h = CreateFile (fh->get_win32_name (),
- fh->get_access () | GENERIC_EXECUTE,
- wincap.shared (), &sec_none_nih,
- OPEN_EXISTING, 0, NULL);
- if (h != INVALID_HANDLE_VALUE)
- {
- fh_disk_file.set_io_handle (h);
- fh_disk_file.set_access (fh->get_access () | GENERIC_EXECUTE);
- fh = &fh_disk_file;
- }
- else if (prot & PROT_EXEC)
- {
- /* TODO: To be or not to be... I'm opting for refusing this
- mmap request rather than faking it, but that might break
- some non-portable code. */
- set_errno (EACCES);
- goto out;
- }
- }
-
- DWORD high;
- DWORD low = GetFileSize (fh->get_handle (), &high);
- _off64_t fsiz = ((_off64_t)high << 32) + low;
-
- /* Don't allow file mappings beginning beyond EOF since Windows can't
- handle that POSIX like, unless MAP_AUTOGROW flag is set, which
- mimics Windows behaviour. */
- if (off >= fsiz && !autogrow (flags))
- {
- /* Instead, it seems suitable to return an anonymous mapping of
- the given size instead. Mapped addresses beyond EOF aren't
- written back to the file anyway, so the handling is identical
- to other pages beyond EOF. */
- fh = &fh_anonymous;
- len = roundup2 (len, pagesize);
- prot = PROT_READ | PROT_WRITE | __PROT_ATTACH;
- flags &= MAP_FIXED;
- flags |= MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE;
- fd = -1;
- off = 0;
- goto go_ahead;
- }
- fsiz -= off;
- /* On NT systems we're creating the pages beyond EOF as reserved,
- anonymous pages. That's not possible on 9x for two reasons.
- It neither allows to create reserved pages in the shared memory
- area, nor does it allow to create page aligend mappings (in
- contrast to granularity aligned mappings).
-
- Note that this isn't done in WOW64 environments since apparently
- WOW64 does not support the AT_ROUND_TO_PAGE flag which is required
- to get this right. Too bad. */
- if (wincap.virtual_protect_works_on_shared_pages ()
- && !wincap.is_wow64 ()
- && ((len > fsiz && !autogrow (flags))
- || len < pagesize))
- orig_len = len;
- if (len > fsiz)
- {
- if (autogrow (flags))
- {
- /* Allow mapping beyond EOF if MAP_AUTOGROW flag is set.
- Check if file has been opened for writing, otherwise
- MAP_AUTOGROW is invalid. */
- if (!(fh->get_access () & GENERIC_WRITE))
- {
- set_errno (EINVAL);
- goto out;
- }
- }
- else
- /* Otherwise, don't map beyond EOF, since Windows would change
- the file to the new length, in contrast to POSIX. */
- len = fsiz;
- }
-
- /* If the requested offset + len is <= file size, drop MAP_AUTOGROW.
- This simplifes fhandler::mmap's job. */
- if (autogrow (flags) && (off + len) <= fsiz)
- flags &= ~MAP_AUTOGROW;
- }
-
-go_ahead:
-
- map_list = mmapped_areas.get_list_by_fd (fd);
-
- /* Test if an existing anonymous mapping can be recycled. */
- if (map_list && anonymous (flags))
- {
- caddr_t tried = map_list->try_map (addr, len, flags, off);
- /* try_map returns NULL if no map matched, otherwise it returns
- a valid address, of MAP_FAILED in case of a fatal error. */
- if (tried)
- {
- ret = tried;
- goto out;
- }
- }
-
- /* Deferred alignment test, see above. */
- if (wincap.has_mmap_alignment_bug ()
- && fixed (flags) && ((uintptr_t) addr % pagesize))
- {
- set_errno (EINVAL);
- goto out;
- }
-
- base = mmap_worker (fh, (caddr_t) addr, len, prot, flags, fd, off);
- if (!base)
- goto out;
-
- if (orig_len)
- {
- /* If the requested length is bigger than the file size, the
- remainder is created as anonymous mapping. Actually two
- mappings are created, first the reminder from the file end to
- the next 64K boundary as accessible pages with the same
- protection as the file's pages, then as much pages as necessary
- to accomodate the requested length, but as reserved pages which
- raise a SIGBUS when trying to access them. AT_ROUND_TO_PAGE
- and page protection on shared pages is only supported by 32 bit NT,
- so don't even try on 9x and in WOW64. This is accomplished by not
- setting orig_len on 9x and in WOW64 above. */
- orig_len = roundup2 (orig_len, pagesize);
- len = roundup2 (len, getsystempagesize ());
- if (orig_len - len)
- {
- orig_len -= len;
- size_t valid_page_len = orig_len % pagesize;
- size_t sigbus_page_len = orig_len - valid_page_len;
-
- caddr_t at_base = base + len;
- if (valid_page_len)
- {
- prot |= __PROT_FILLER;
- flags &= MAP_SHARED | MAP_PRIVATE;
- flags |= MAP_ANONYMOUS | MAP_FIXED;
- at_base = mmap_worker (&fh_anonymous, at_base, valid_page_len,
- prot, flags, -1, 0);
- if (!at_base)
- {
- fh->munmap (fh->get_handle (), base, len);
- set_errno (ENOMEM);
- goto out;
- }
- at_base += valid_page_len;
- }
- if (sigbus_page_len)
- {
- prot = PROT_READ | PROT_WRITE | __PROT_ATTACH;
- flags = MAP_ANONYMOUS | MAP_NORESERVE | MAP_FIXED;
- at_base = mmap_worker (&fh_anonymous, at_base, sigbus_page_len,
- prot, flags, -1, 0);
- if (!at_base)
- debug_printf ("Warning: Mapping beyond EOF failed, %E");
- }
- }
- }
-
- ret = base;
-
-out:
-
- ReleaseResourceLock (LOCK_MMAP_LIST, READ_LOCK | WRITE_LOCK, "mmap");
-
- if (fh_disk_file.get_handle ())
- CloseHandle (fh_disk_file.get_handle ());
-
- syscall_printf ("%p = mmap() ", ret);
- return ret;
-}
-
-extern "C" void *
-mmap (void *addr, size_t len, int prot, int flags, int fd, _off_t off)
-{
- return mmap64 (addr, len, prot, flags, fd, (_off64_t)off);
-}
-
-/* munmap () removes all mmapped pages between addr and addr+len. */
-
-extern "C" int
-munmap (void *addr, size_t len)
-{
- syscall_printf ("munmap (addr %x, len %u)", addr, len);
-
- /* Error conditions according to SUSv3 */
- if (!addr || !len || check_invalid_virtual_addr (addr, len))
- {
- set_errno (EINVAL);
- return -1;
- }
- /* See comment in mmap64 for a description. */
- size_t pagesize = wincap.has_mmap_alignment_bug () ?
- getsystempagesize () : getpagesize ();
- if (((uintptr_t) addr % pagesize) || !len)
- {
- set_errno (EINVAL);
- return -1;
- }
- len = roundup2 (len, pagesize);
-
- SetResourceLock (LOCK_MMAP_LIST, WRITE_LOCK | READ_LOCK, "munmap");
-
- /* Iterate through the map, unmap pages between addr and addr+len
- in all maps. */
- list *map_list;
- for (unsigned list_idx = 0;
- (map_list = mmapped_areas.get_list (list_idx));
- ++list_idx)
- {
- long record_idx = -1;
- caddr_t u_addr;
- DWORD u_len;
-
- while ((record_idx = map_list->search_record((caddr_t)addr, len, u_addr,
- u_len, record_idx)) >= 0)
- {
- mmap_record *rec = map_list->get_record (record_idx);
- if (rec->unmap_pages (u_addr, u_len))
- {
- /* The whole record has been unmapped, so we now actually
- unmap it from the system in full length... */
- fhandler_base *fh = rec->alloc_fh ();
- fh->munmap (rec->get_handle (),
- rec->get_address (),
- rec->get_len ());
- rec->free_fh (fh);
-
- /* ...and delete the record. */
- if (map_list->del_record (record_idx--))
- {
- /* Yay, the last record has been removed from the list,
- we can remove the list now, too. */
- mmapped_areas.del_list (list_idx--);
- break;
- }
- }
- }
- }
-
- ReleaseResourceLock (LOCK_MMAP_LIST, WRITE_LOCK | READ_LOCK, "munmap");
- syscall_printf ("0 = munmap(): %x", addr);
- return 0;
-}
-
-/* Sync file with memory. Ignore flags for now. */
-
-extern "C" int
-msync (void *addr, size_t len, int flags)
-{
- int ret = -1;
- list *map_list;
-
- syscall_printf ("msync (addr: %p, len %u, flags %x)", addr, len, flags);
-
- SetResourceLock (LOCK_MMAP_LIST, WRITE_LOCK | READ_LOCK, "msync");
-
- /* See comment in mmap64 for a description. */
- size_t pagesize = wincap.has_mmap_alignment_bug () ?
- getsystempagesize () : getpagesize ();
- if (((uintptr_t) addr % pagesize)
- || (flags & ~(MS_ASYNC | MS_SYNC | MS_INVALIDATE))
- || (flags & (MS_ASYNC | MS_SYNC) == (MS_ASYNC | MS_SYNC)))
- {
- set_errno (EINVAL);
- goto out;
- }
- len = roundup2 (len, pagesize);
-
- /* Iterate through the map, looking for the mmapped area.
- Error if not found. */
- for (unsigned list_idx = 0;
- (map_list = mmapped_areas.get_list (list_idx));
- ++list_idx)
- {
- mmap_record *rec;
- for (int record_idx = 0;
- (rec = map_list->get_record (record_idx));
- ++record_idx)
- {
- if (rec->access ((caddr_t)addr))
- {
- /* Check whole area given by len. */
- for (DWORD i = getpagesize (); i < len; ++i)
- if (!rec->access ((caddr_t)addr + i))
- {
- set_errno (ENOMEM);
- goto out;
- }
- fhandler_base *fh = rec->alloc_fh ();
- ret = fh->msync (rec->get_handle (), (caddr_t)addr, len, flags);
- rec->free_fh (fh);
- goto out;
- }
- }
- }
-
- /* No matching mapping exists. */
- set_errno (ENOMEM);
-
-out:
- syscall_printf ("%d = msync()", ret);
- ReleaseResourceLock (LOCK_MMAP_LIST, WRITE_LOCK | READ_LOCK, "msync");
- return ret;
-}
-
-/* Set memory protection */
-
-extern "C" int
-mprotect (void *addr, size_t len, int prot)
-{
- bool in_mapped = false;
- bool ret = false;
- DWORD old_prot;
- DWORD new_prot = 0;
-
- syscall_printf ("mprotect (addr: %p, len %u, prot %x)", addr, len, prot);
-
- /* See comment in mmap64 for a description. */
- size_t pagesize = wincap.has_mmap_alignment_bug () ?
- getsystempagesize () : getpagesize ();
- if ((uintptr_t) addr % pagesize)
- {
- set_errno (EINVAL);
- goto out;
- }
- len = roundup2 (len, pagesize);
-
- SetResourceLock (LOCK_MMAP_LIST, WRITE_LOCK | READ_LOCK, "mprotect");
-
- /* Iterate through the map, protect pages between addr and addr+len
- in all maps. */
- list *map_list;
- for (unsigned list_idx = 0;
- (map_list = mmapped_areas.get_list (list_idx));
- ++list_idx)
- {
- long record_idx = -1;
- caddr_t u_addr;
- DWORD u_len;
-
- while ((record_idx = map_list->search_record((caddr_t)addr, len,
- u_addr, u_len,
- record_idx)) >= 0)
- {
- mmap_record *rec = map_list->get_record (record_idx);
- in_mapped = true;
- if (rec->attached ())
- continue;
- new_prot = gen_protect (prot, rec->get_flags ());
- if (rec->anonymous () && rec->priv () && rec->noreserve ())
- {
- if (new_prot == PAGE_NOACCESS)
- ret = VirtualFree (u_addr, u_len, MEM_DECOMMIT);
- else
- ret = !!VirtualAlloc (u_addr, u_len, MEM_COMMIT, new_prot);
- }
- else
- ret = VirtualProtect (u_addr, u_len, new_prot, &old_prot);
- if (!ret)
- {
- __seterrno ();
- break;
- }
- }
- }
-
- ReleaseResourceLock (LOCK_MMAP_LIST, WRITE_LOCK | READ_LOCK, "mprotect");
-
- if (!in_mapped)
- {
- int flags = 0;
- MEMORY_BASIC_INFORMATION mbi;
-
- ret = VirtualQuery (addr, &mbi, sizeof mbi);
- if (ret)
- {
- /* If write protection is requested, check if the page was
- originally protected writecopy. In this case call VirtualProtect
- requesting PAGE_WRITECOPY, otherwise the VirtualProtect will fail
- on NT version >= 5.0 */
- if (prot & PROT_WRITE)
- {
- if (mbi.AllocationProtect == PAGE_WRITECOPY
- || mbi.AllocationProtect == PAGE_EXECUTE_WRITECOPY)
- flags = MAP_PRIVATE;
- }
- new_prot = gen_protect (prot, flags);
- if (new_prot != PAGE_NOACCESS && mbi.State == MEM_RESERVE)
- ret = VirtualAlloc (addr, len, MEM_COMMIT, new_prot);
- else
- ret = VirtualProtect (addr, len, new_prot, &old_prot);
- }
- if (!ret)
- __seterrno ();
- }
-
-out:
-
- syscall_printf ("%d = mprotect ()", ret ? 0 : -1);
- return ret ? 0 : -1;
-}
-
-extern "C" int
-mlock (const void *addr, size_t len)
-{
- if (!wincap.has_working_virtual_lock ())
- return 0;
-
- int ret = -1;
-
- /* Instead of using VirtualLock, which does not guarantee that the pages
- aren't swapped out when the process is inactive, we're using
- ZwLockVirtualMemory with the LOCK_VM_IN_RAM flag to do what mlock on
- POSIX systems does. On NT, this requires SeLockMemoryPrivilege,
- which is given only to SYSTEM by default. */
-
- push_thread_privilege (SE_LOCK_MEMORY_PRIV, true);
-
- /* Align address and length values to page size. */
- size_t pagesize = getpagesize ();
- PVOID base = (PVOID) rounddown((uintptr_t) addr, pagesize);
- ULONG size = roundup2 (((uintptr_t) addr - (uintptr_t) base) + len, pagesize);
- NTSTATUS status = 0;
- do
- {
- status = NtLockVirtualMemory (hMainProc, &base, &size, LOCK_VM_IN_RAM);
- if (status == STATUS_WORKING_SET_QUOTA)
- {
- /* The working set is too small, try to increase it so that the
- requested locking region fits in. Unfortunately I don't know
- any function which would return the currently locked pages of
- a process (no go with NtQueryVirtualMemory).
-
- So, except for the border cases, what we do here is something
- really embarrassing. We raise the working set by 64K at a time
- and retry, until either we fail to raise the working set size
- further, or until NtLockVirtualMemory returns successfully (or
- with another error). */
- ULONG min, max;
- if (!GetProcessWorkingSetSize (hMainProc, &min, &max))
- {
- set_errno (ENOMEM);
- break;
- }
- if (min < size)
- min = size + pagesize;
- else if (size < pagesize)
- min += size;
- else
- min += pagesize;
- if (max < min)
- max = min;
- if (!SetProcessWorkingSetSize (hMainProc, min, max))
- {
- set_errno (ENOMEM);
- break;
- }
- }
- else if (!NT_SUCCESS (status))
- __seterrno_from_nt_status (status);
- else
- ret = 0;
- }
- while (status == STATUS_WORKING_SET_QUOTA);
-
- pop_thread_privilege ();
-
- return ret;
-}
-
-extern "C" int
-munlock (const void *addr, size_t len)
-{
- if (!wincap.has_working_virtual_lock ())
- return 0;
-
- int ret = -1;
-
- push_thread_privilege (SE_LOCK_MEMORY_PRIV, true);
-
- /* Align address and length values to page size. */
- size_t pagesize = getpagesize ();
- PVOID base = (PVOID) rounddown((uintptr_t) addr, pagesize);
- ULONG size = roundup2 (((uintptr_t) addr - (uintptr_t) base) + len, pagesize);
- NTSTATUS status = NtUnlockVirtualMemory (hMainProc, &base, &size,
- LOCK_VM_IN_RAM);
- if (!NT_SUCCESS (status))
- __seterrno_from_nt_status (status);
- else
- ret = 0;
-
- pop_thread_privilege ();
-
- return ret;
-}
-
-/*
- * Base implementation:
- *
- * `mmap' returns ENODEV as documented in SUSv2.
- * In contrast to the global function implementation, the member function
- * `mmap' has to return the mapped base address in `addr' and the handle to
- * the mapping object as return value. In case of failure, the fhandler
- * mmap has to close that handle by itself and return INVALID_HANDLE_VALUE.
- *
- * `munmap' and `msync' get the handle to the mapping object as first parameter
- * additionally.
-*/
-HANDLE
-fhandler_base::mmap (caddr_t *addr, size_t len, int prot,
- int flags, _off64_t off)
-{
- set_errno (ENODEV);
- return INVALID_HANDLE_VALUE;
-}
-
-int
-fhandler_base::munmap (HANDLE h, caddr_t addr, size_t len)
-{
- set_errno (ENODEV);
- return -1;
-}
-
-int
-fhandler_base::msync (HANDLE h, caddr_t addr, size_t len, int flags)
-{
- set_errno (ENODEV);
- return -1;
-}
-
-bool
-fhandler_base::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
- _off64_t offset, DWORD size,
- void *address)
-{
- set_errno (ENODEV);
- return -1;
-}
-
-/* Implementation for anonymous maps. Using fhandler_dev_zero looks
- quite the natural way. */
-HANDLE
-fhandler_dev_zero::mmap (caddr_t *addr, size_t len, int prot,
- int flags, _off64_t off)
-{
- HANDLE h;
- void *base;
-
- if (priv (flags) && !filler (prot))
- {
- /* Private anonymous maps are now implemented using VirtualAlloc.
- This has two advantages:
-
- - VirtualAlloc has a smaller footprint than a copy-on-write
- anonymous map.
-
- - It supports decommitting using VirtualFree, in contrast to
- section maps. This allows minimum footprint private maps,
- when using the (non-POSIX, yay-Linux) MAP_NORESERVE flag.
- */
- DWORD protect = gen_protect (prot, flags);
- DWORD alloc_type = MEM_RESERVE | (noreserve (flags) ? 0 : MEM_COMMIT);
- base = VirtualAlloc (*addr, len, alloc_type, protect);
- if (!base && addr && !fixed (flags))
- base = VirtualAlloc (NULL, len, alloc_type, protect);
- if (!base || (fixed (flags) && base != *addr))
- {
- if (!base)
- __seterrno ();
- else
- {
- VirtualFree (base, 0, MEM_RELEASE);
- set_errno (EINVAL);
- debug_printf ("VirtualAlloc: address shift with MAP_FIXED given");
- }
- return INVALID_HANDLE_VALUE;
- }
- h = (HANDLE) 1; /* Fake handle to indicate success. */
- }
- else
- {
- h = mmap_func->CreateMapping (get_handle (), len, off, get_access (),
- prot, flags, get_win32_name ());
- if (!h)
- {
- __seterrno ();
- debug_printf ("CreateMapping failed with %E");
- return INVALID_HANDLE_VALUE;
- }
-
- base = mmap_func->MapView (h, *addr, len, get_access(), prot, flags, off);
- if (!base || (fixed (flags) && base != *addr))
- {
- if (!base)
- __seterrno ();
- else
- {
- UnmapViewOfFile (base);
- set_errno (EINVAL);
- debug_printf ("MapView: address shift with MAP_FIXED given");
- }
- CloseHandle (h);
- return INVALID_HANDLE_VALUE;
- }
- }
- *addr = (caddr_t) base;
- return h;
-}
-
-int
-fhandler_dev_zero::munmap (HANDLE h, caddr_t addr, size_t len)
-{
- if (h == (HANDLE) 1) /* See fhandler_dev_zero::mmap. */
- VirtualFree (addr, 0, MEM_RELEASE);
- else
- {
- UnmapViewOfFile (addr);
- CloseHandle (h);
- }
- return 0;
-}
-
-int
-fhandler_dev_zero::msync (HANDLE h, caddr_t addr, size_t len, int flags)
-{
- return 0;
-}
-
-bool
-fhandler_dev_zero::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
- _off64_t offset, DWORD size,
- void *address)
-{
- /* Re-create the map */
- void *base;
- if (priv (flags) && !filler (prot))
- {
- DWORD alloc_type = MEM_RESERVE | (noreserve (flags) ? 0 : MEM_COMMIT);
- /* Always allocate R/W so that ReadProcessMemory doesn't fail
- due to a non-writable target address. The protection is
- set to the correct one anyway in the fixup loop. */
- base = VirtualAlloc (address, size, alloc_type, PAGE_READWRITE);
- }
- else
- base = mmap_func->MapView (h, address, size, get_access (),
- prot, flags, offset);
- if (base != address)
- {
- MEMORY_BASIC_INFORMATION m;
- VirtualQuery (address, &m, sizeof (m));
- system_printf ("requested %p != %p mem alloc base %p, state %p, "
- "size %d, %E", address, base, m.AllocationBase, m.State,
- m.RegionSize);
- }
- return base == address;
-}
-
-/* Implementation for disk files and anonymous mappings. */
-HANDLE
-fhandler_disk_file::mmap (caddr_t *addr, size_t len, int prot,
- int flags, _off64_t off)
-{
- HANDLE h = mmap_func->CreateMapping (get_handle (), len, off, get_access (),
- prot, flags, get_win32_name ());
- if (!h)
- {
- __seterrno ();
- debug_printf ("CreateMapping failed with %E");
- return INVALID_HANDLE_VALUE;
- }
-
- void *base = mmap_func->MapView (h, *addr, len, get_access (),
- prot, flags, off);
- if (!base || (fixed (flags) && base != *addr))
- {
- if (!base)
- __seterrno ();
- else
- {
- UnmapViewOfFile (base);
- set_errno (EINVAL);
- debug_printf ("MapView: address shift with MAP_FIXED given");
- }
- CloseHandle (h);
- return INVALID_HANDLE_VALUE;
- }
-
- *addr = (caddr_t) base;
- return h;
-}
-
-int
-fhandler_disk_file::munmap (HANDLE h, caddr_t addr, size_t len)
-{
- UnmapViewOfFile (addr);
- CloseHandle (h);
- return 0;
-}
-
-int
-fhandler_disk_file::msync (HANDLE h, caddr_t addr, size_t len, int flags)
-{
- if (FlushViewOfFile (addr, len) == 0)
- {
- __seterrno ();
- return -1;
- }
- return 0;
-}
-
-bool
-fhandler_disk_file::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
- _off64_t offset, DWORD size,
- void *address)
-{
- /* Re-create the map */
- void *base = mmap_func->MapView (h, address, size, get_access (),
- prot, flags, offset);
- if (base != address)
- {
- MEMORY_BASIC_INFORMATION m;
- VirtualQuery (address, &m, sizeof (m));
- system_printf ("requested %p != %p mem alloc base %p, state %p, "
- "size %d, %E", address, base, m.AllocationBase, m.State,
- m.RegionSize);
- }
- return base == address;
-}
-
-HANDLE
-fhandler_dev_mem::mmap (caddr_t *addr, size_t len, int prot,
- int flags, _off64_t off)
-{
- if (off >= mem_size
- || (DWORD) len >= mem_size
- || off + len >= mem_size)
- {
- set_errno (EINVAL);
- debug_printf ("-1 = mmap(): illegal parameter, set EINVAL");
- return INVALID_HANDLE_VALUE;
- }
-
- UNICODE_STRING memstr;
- RtlInitUnicodeString (&memstr, L"\\device\\physicalmemory");
-
- OBJECT_ATTRIBUTES attr;
- InitializeObjectAttributes (&attr, &memstr,
- OBJ_CASE_INSENSITIVE | OBJ_INHERIT,
- NULL, NULL);
-
- /* Section access is bit-wise ored, while on the Win32 level access
- is only one of the values. It's not quite clear if the section
- access has to be defined this way, or if SECTION_ALL_ACCESS would
- be sufficient but this worked fine so far, so why change? */
- ACCESS_MASK section_access;
- if (prot & PROT_WRITE)
- section_access = SECTION_MAP_READ | SECTION_MAP_WRITE;
- else
- section_access = SECTION_MAP_READ;
-
- HANDLE h;
- NTSTATUS ret = NtOpenSection (&h, section_access, &attr);
- if (!NT_SUCCESS (ret))
- {
- __seterrno_from_nt_status (ret);
- debug_printf ("-1 = mmap(): NtOpenSection failed with %E");
- return INVALID_HANDLE_VALUE;
- }
-
- void *base = MapViewNT (h, *addr, len, get_access (),
- prot, flags | MAP_ANONYMOUS, off);
- if (!base || (fixed (flags) && base != *addr))
- {
- if (!base)
- __seterrno ();
- else
- {
- NtUnmapViewOfSection (GetCurrentProcess (), base);
- set_errno (EINVAL);
- debug_printf ("MapView: address shift with MAP_FIXED given");
- }
- CloseHandle (h);
- return INVALID_HANDLE_VALUE;
- }
-
- *addr = (caddr_t) base;
- return h;
-}
-
-int
-fhandler_dev_mem::munmap (HANDLE h, caddr_t addr, size_t len)
-{
- NTSTATUS ret;
- if (!NT_SUCCESS (ret = NtUnmapViewOfSection (INVALID_HANDLE_VALUE, addr)))
- {
- __seterrno_from_nt_status (ret);
- return -1;
- }
- CloseHandle (h);
- return 0;
-}
-
-int
-fhandler_dev_mem::msync (HANDLE h, caddr_t addr, size_t len, int flags)
-{
- return 0;
-}
-
-bool
-fhandler_dev_mem::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
- _off64_t offset, DWORD size,
- void *address)
-{
- void *base = MapViewNT (h, address, size, get_access (), prot,
- flags | MAP_ANONYMOUS, offset);
- if (base != address)
- {
- MEMORY_BASIC_INFORMATION m;
- VirtualQuery (address, &m, sizeof (m));
- system_printf ("requested %p != %p mem alloc base %p, state %p, "
- "size %d, %E", address, base, m.AllocationBase, m.State,
- m.RegionSize);
- }
- return base == address;
-}
-
-/* Call to re-create all the file mappings in a forked child. Called from
- the child in initialization. At this point we are passed a valid
- mmapped_areas map, and all the HANDLE's are valid for the child, but
- none of the mapped areas are in our address space. We need to iterate
- through the map, doing the MapViewOfFile calls. */
-
-int __stdcall
-fixup_mmaps_after_fork (HANDLE parent)
-{
- /* Iterate through the map */
- list *map_list;
- for (unsigned list_idx = 0;
- (map_list = mmapped_areas.get_list (list_idx));
- ++list_idx)
- {
- mmap_record *rec;
- for (int record_idx = 0;
- (rec = map_list->get_record (record_idx));
- ++record_idx)
- {
- debug_printf ("fd %d, h 0x%x, address %p, len 0x%x, prot: 0x%x, "
- "flags: 0x%x, offset %X",
- rec->get_fd (), rec->get_handle (), rec->get_address (),
- rec->get_len (), rec->get_prot (), rec->get_flags (),
- rec->get_offset ());
-
- fhandler_base *fh = rec->alloc_fh ();
- bool ret = fh->fixup_mmap_after_fork (rec->get_handle (),
- rec->get_prot (),
- rec->get_flags () | MAP_FIXED,
- rec->get_offset (),
- rec->get_len (),
- rec->get_address ());
- rec->free_fh (fh);
-
- if (!ret)
- {
- if (rec->attached ())
- {
- system_printf ("Warning: Fixup mapping beyond EOF failed");
- continue;
- }
- return -1;
- }
-
- MEMORY_BASIC_INFORMATION mbi;
- DWORD old_prot;
-
- for (char *address = rec->get_address ();
- address < rec->get_address () + rec->get_len ();
- address += mbi.RegionSize)
- {
- if (!VirtualQueryEx (parent, address, &mbi, sizeof mbi))
- {
- system_printf ("VirtualQueryEx failed for MAP_PRIVATE "
- "address %p, %E", address);
- return -1;
- }
- /* Just skip reserved pages. */
- if (mbi.State == MEM_RESERVE)
- continue;
- /* Copy-on-write pages must be copied to the child to circumvent
- a strange notion how copy-on-write is supposed to work. */
- if (rec->priv ())
- {
- if (rec->anonymous () && rec->noreserve ()
- && !VirtualAlloc (address, mbi.RegionSize,
- MEM_COMMIT, PAGE_READWRITE))
- {
- system_printf ("VirtualAlloc failed for MAP_PRIVATE "
- "address %p, %E", address);
- return -1;
- }
- if (mbi.Protect == PAGE_NOACCESS
- && !VirtualProtectEx (parent, address, mbi.RegionSize,
- PAGE_READONLY, &old_prot))
- {
- system_printf ("VirtualProtectEx failed for MAP_PRIVATE "
- "address %p, %E", address);
- return -1;
- }
- else if ((mbi.AllocationProtect == PAGE_WRITECOPY
- || mbi.AllocationProtect == PAGE_EXECUTE_WRITECOPY)
- && (mbi.Protect == PAGE_READWRITE
- || mbi.Protect == PAGE_EXECUTE_READWRITE))
- /* A WRITECOPY page which has been written to is set to
- READWRITE, but that's an incompatible protection to
- set the page to. Convert the protection to WRITECOPY
- so that the below VirtualProtect doesn't fail. */
- mbi.Protect <<= 1;
-
- if (!ReadProcessMemory (parent, address, address,
- mbi.RegionSize, NULL))
- {
- system_printf ("ReadProcessMemory failed for MAP_PRIVATE "
- "address %p, %E", address);
- return -1;
- }
- if (mbi.Protect == PAGE_NOACCESS
- && !VirtualProtectEx (parent, address, mbi.RegionSize,
- PAGE_NOACCESS, &old_prot))
- {
- system_printf ("WARNING: VirtualProtectEx to return to "
- "PAGE_NOACCESS state in parent failed for "
- "MAP_PRIVATE address %p, %E", address);
- return -1;
- }
- }
- /* Set child page protection to parent protection */
- if (!VirtualProtect (address, mbi.RegionSize,
- mbi.Protect, &old_prot))
- {
- MEMORY_BASIC_INFORMATION m;
- VirtualQuery (address, &m, sizeof m);
- system_printf ("VirtualProtect failed for "
- "address %p, "
- "parentstate: 0x%x, "
- "state: 0x%x, "
- "parentprot: 0x%x, "
- "prot: 0x%x, %E",
- address, mbi.State, m.State,
- mbi.Protect, m.Protect);
- return -1;
- }
- }
- }
- }
-
- debug_printf ("succeeded");
- return 0;
-}