settings.
(dtable::fixup_after_fork): Ditto.
* exceptions.cc (set_sig_errno): Remove some debugging output.
* path.cc (path_conv::check): Don't OR need_directory with flags sent to
symlink_info::check.
(symlink_info::check): Use PATH_ALL_EXEC to determine when a file is
executable.
* path.h (path_types): Add PATH_ALL_EXEC.
(isexec): Use PATH_ALL_EXEC so that cygexec types will be considered
executable.
* pinfo.h (_pinfo): Add a process handle that is kept open throughout the life
of a cygwin pid.
* sigproc.cc (proc_exists): Remove hopefully obsolete stuff.
(proc_subproc): Set up process handle that is kept open throughout the life of
a cygwin pid. Reorganize PROC_WAIT stuff to use common code.
(proc_terminate): Close pid lifetime process handle.
(checkstate): Cleanup.
(stopped_or_terminated): Move zombie cleanup.
(remove_zombie): To here.
* spawn.cc (spawn_guts): Reorganize reparenting code for 1247th time.
* include/subauth.h: Ditto.
* include/ipexport.h: Fix global header define not to contain
trailing underscore. Change layout according to standard.
* include/iphlpapi.h: Ditto.
* include/ipifcons.h: Ditto.
* include/iptypes.h: Ditto.
* include/ntdef.h: Ditto. Define conditional datatypes dependent
of inclusion of ntdecapi.h and subauth.h.
* lib/secur32.def: New stub for secur32.dll.
* fhandler.cc (fhandler_base::open): Ditto.
* fhandler.cc (fhandler_base::fhandler_base): Ditto.
(fhandler_base::read): Ditto. Add more debugging output. Don't issue a \r
when \r\n detected.
* pipe.cc (make_pipe): Streamline slightly. Make debug output more
interesting.
* strace.cc (strace::vsprintf): Use __progname where appropriate to distinguish
strace output when exec'ing.
Add `unit' member.
* fhandler_mem.cc (fhandler_dev_mem): Initialize `unit' as well.
(init): Care for differences between /dev/mem, /dev/kmem (not
implemented yet) and /dev/port.
(open): Change debug message to reflect the device.
(mmap): New function.
(munmap): Ditto.
(msync): Ditto.
(fstat): Use unit when setting st_dev in stat structure.
* mmap.cc (mmap): Handle MAP_ANONYMOUS flag.
Change error handling slightly.
* path.cc (get_device_number): Handle /dev/port.
specific call when appropriate.
(__set_winsock_errno): Rename from set_winsock_errno. Accept function and line
as arguments.
* path.cc (path_conv::check): Continue the neverending battle to make cygwin
properly understand that path specs ending in a slash require that the path
refer to a directory. Windows does not do this by default.
(symlink_info::check): Remove ENOTDIR test. Move it to path_conv::check.
* path.h: Remove obsolete constant.
* winsup.h (set_winsock_errno): New macro.
These changes require rebuilding all.
=====================================
* fhandler.h: Add mmap(), munmap() and msync() to fhandler_base
and fhandler_disk_file.
* mmem.cc (mmap): Eliminated device dependent implementation details.
These are moved to the appropriate fhandler class.
(munmap): Ditto.
(msync): Ditto.
(fhandler_base::mmap): New method.
(fhandler_base::munmap): Ditto.
(fhandler_base::msync): Ditto.
(fhandler_disk_file::mmap): Ditto.
(fhandler_disk_file::munmap): Ditto.
(fhandler_disk_file::msync): Ditto.
`mem_size' and `init_phase'.
* fhandler_mem.cc (init): New function to figure out the size of
the physical memory.
(open): Add checking for illegal flags. Change usage of access mode.
(write): Add intended functionality.
(read): Add parameter checking. Eliminate page size constant. Use
getpagesize() instead. Don't touch errno and don't create debug output
while init() is running.
(lseek): Add bounds checking. Fix SEEK_END.
(fstat): Eliminate page size constant. Use getpagesize() instead.
(dup): Add intended functionality.
(_cmalloc): Reorganize to accomodate muto locking.
(_cfree): Use muto lock to avoid multi-thread problems.
* cygheap.h (incygheap): Just use cygheap_max to find upper cygwin heap bounds.
* dcrt0.cc (dll_crt0_1): Reinstitute cygheap_init call.
* path.cc (getcwd): Just return cwdstuff::get result, allowing correct handling
of negative length.
(cwdstuff::get): Malloc a buffer if one is not available.
* dtable.cc (dtable::build_fhandler): Add case for FH_MEM.
* fhandler.h: Add FH_MEM device type. Add class fhandler_dev_mem.
* fhandler_mem.cc: New file. Implementation of class fhandler_dev_mem.
* path.cc: Add /dev/mem to windows_device_names.
(get_device_number): Add FH_MEM type.
(_csbrk): Make logic for detecting when to alloc cognizant of initialization
condition.
(_cmalloc): Use a structure to hold bucket size and heap chain pointer. Store
pointer to next freed block in bucket size location so that it will be easy to
see if a block is allocated.
(_cfree): Store pointer to next freed block in bucket size location.
(_crealloc): Use macro to retrieve bucket size.
(cygheap_init): Eliminate.
(cygheap_fixup_in_child): Add second argument to determine if we were execed or
not. In execed case, walk the heap, cleaning up any orphaned blocks.
* cygheap.h: Add a "MAX" value to cygheap_types. Remove cygheap_init
declaration. Accomodate new argument to cygheap_fixup_in child.
* fork.cc (fork): Accomodate extra argument to cygheap_fixup_in_child.
* dcrt0.cc (dll_crt0_1): Ditto. Remove call to cygheap_init.
(check_keys): New function. Perform checking keycodes.
(main): Add option `-k' for invoking check_keys.
Change option processing to use long options and getopt_long.
* cygkeycheck.cc: Removed. Functionality moved to `cygcheck.cc'.
* Makefile.in: Remove cygkeycheck from the dependencies.
subfunctions instead.
(get_9x_ifconf): New function for 9X systems, called by get_ifconf.
(get_nt_ifconf): New function for NT systems, called by get_ifconf.
(get_2k_ifconf): New function for W2K systems, called by get_ifconf.
* fhandler.h (fhandler_socket::~fhandler_socket): Delete declaration.
* net.cc: Remove unnecessary "number_of_sockets" usage.
(fhandler_socket::fhandler_socket): Ditto.
(fhandler_socket::~fhandler_socket): Delete definition.
* spawn.cc (spawn_guts): Force first argument passed to CreateProcess as a
command line to be windows style.
* environ.cc (environ_init): Remember to reparse CYGWIN if envp is
supplied.
* heap.cc (_sbrk): Remember frame for signal handling.
* syscalls.cc (read_handler): Eliminate.
(_read): Move read_handler code here. Reorganize for one path through
'ready_for_read'.
* path.cc (path::check): Detect trailing slash before converting to windows
path. Tell symlink_info::check to check for directory if one is found.
(symlink_info::check): Set errno when path is not a directory if pflags &
PATH_NEEDDIR.
points have the cygdrive prefix.
* (mount_info::add_reg_mount): Properly catch errors on registry operations.
* (mount_info::write_cygdrive_info_to_registry): Ditto.
* (mount_info::del_reg_mount): Cosmetic changes to be consistent with other
methods.
* (mount_info::add_item): Check arguments more precisely. Increment nmounts
only when registry operations succeed.