* heap.cc (heap_init): Be slightly more aggressive when trying to allocate
heap. Change fatal error to avoid confusion with cygheap.
* spawn.cc (linebuf::finish): New function.
(linebuf::add): Cosmetic change.
(spawn_guts): Only avoid building windows command line if the program being
executed was actually mounted with -X. Don't return E2BIG if we hit the 32K
size and we're executing a detected cygwin program. Just silently truncate the
windows command line, instead.
* fhandler_serial.cc (fhandler_serial::ioctl): Always return 0 for window size.
* termios.cc (tcgetattr): Clear out baud part of c_cflag since it is always
ignored.
Jeff Johnston [Thu, 8 Sep 2005 22:45:53 +0000 (22:45 +0000)]
2005-09-08 Jeff Johnston <jjohnstn@redhat.com>
* Makefile.am: Add include files under bits sub-directory.
* Makefile.in: Regenerated.
* libc/sys/linux/argp/argp-fs-xinl.c: Set __OPTIMIZE__ to
actual value of 1 to be compatible with newer glibc headers.
* libc/sys/linux/sys/cdefs.h: Fix to be compatible with newer
glibc headers.
* libc/sys/linux/sys/dirent.h: Ditto.
* libc/sys/linux/argp/argp-xinl.c: Ditto.
* libc/sys/linux/dl/dl-runtime.c: Make sure fixup and
profile_fixup routines are marked used so they won't be
optimized away.
* libc/sys/linux/dl/dl-cache.c: Don't use weak_extern macro
to mark functions as weak.
* libc/sys/linux/dl/dl-open.c: Ditto.
* libc/sys/linux/iconv/gconv_open.c: Fix to obey new gcc4
rules about lvalues.
* libc/sys/linux/iconv/gconv_simple.c: Ditto.
* libc/sys/linux/linuxthreads/bits/libc-lock.h: Don't use
weak_extern macro to mark functions as weak. Instead always
use #pragma weak.
* iconvdata/jis0208.h: Fix to work with gcc4.
* libc/sys/linux/dl/dl-load.c: Ditto.
* libc/sys/linux/dl/dl-reloc.c: Ditto.
* libc/sys/linux/dl/do-rel.h: Ditto.
* libc/sys/linux/dl/dynamic-link.h: Ditto.
* libc/sys/linux/include/ltdl.h: Ditto.
* libc/sys/linux/machine/i386/dl-machine.h: Ditto.
* libc/sys/linux/machine/i386/weakalias.h: Ditto.
* libc/sys/linux/net/ns_ntoa.c: Ditto.
* libc/sys/linux/bits/initspin.h: New file.
* libc/sys/linux/bits/libc-lock.h: Ditto.
* libc/sys/linux/bits/pthreadtypes.h: Ditto.
* libc/sys/linux/bits/typesizes.h: Ditto.
* regtool.cc: Extend copyright-years.
(print_version): Ditto.
(cmd_list): Don't depend on terminating '\0' being present on
string-values.
(cmd_get): Don't attempt to read more than present, but keep
extra space for terminating '\0'. Really output REG_BINARY.
Don't leak memory.
(cmd_set): Include trailing '\0' in string's length.
* hookapi.cc (rvadelta): Change argument to DWORD to eliminate a compiler
warning.
* path.h (path_conv::set_cygexec): New function.
* spawn.cc (av::iscygwin): Eliminate.
(av::av): Don't initialize iscygwin.
(spawn_guts): Just use real_path.iscygexec for all tests.
(av::fixup): Short circuit test if .exe extension and known cygexec. Set
cygexec flag appropriately if we find that program uses cygwin1.dll.
* dcrt0.cc (initial_env): Don't attempt stracing if dynamically loaded.
(dll_crt0_0): Move console initialization earlier.
* init.cc (dll_entry): Move console initialization here.
* exceptions.cc (init_console_handler): Fully remove any old console handler.
* spawn.cc (spawn_guts): Don't fill out windows argv if we've deduced that this
is a cygwin-using program.
(av::fixup): Always check executables to see if they are using cygwin1.dll.
Don't consider .com files to be scripts.
* hookapi.cc (rvadelta): New function.
(PEHeaderFromHModule): Simplify slightly.
(hook_or_detect_cygwin): Use passed in name argument for "HMODULE" rather than
incorrectly reading current program. Calculate delta needed to read image data
and file names if this isn't a real "HMODULE".
Ben Elliston [Wed, 7 Sep 2005 00:42:19 +0000 (00:42 +0000)]
Import from Autoconf sources:
2005-09-06 Paul Eggert <eggert@cs.ucla.edu>
* move-if-change: Don't output "$2 is unchanged"; suggested by Ben
Elliston. Handle weird characters correctly.
* cygheap.cc (cygheap_init): Eliminate debugging #if.
* fork.cc (fork_parent): Don't issue errors if "somebody" has set the
PID_EXITED flag on a child. Don't close process handle if it has potentially
already been closed.
* pinfo.cc (winpids::add): Eliminate PID_ALLPIDS handling which was obsoleted
by previous changes.
* spawn.cc (av::fixup): Do win16 detection for .com files. Make sure that
buffer has been unmapped in all cases.
Jeff Johnston [Wed, 31 Aug 2005 20:39:43 +0000 (20:39 +0000)]
2005-08-31 Paul Brook <paul@codesourcery.com>
* configure.host: Set have_crt0 to no for Arm targts when not
providing syscalls. Set sys_dir=arm unconditionally.
Default have_crt0 based on sys_dir.
* configure.in: Use have_crt0.
* libc/configure.in: Ditto.
* libc/sys/configure.in: Ditto.
* configure: Regenerate.
* libc/configure: Regenerate.
* libc/sys/configure: Regenerate.
* libc/sys/arm/Makefile.am (lib_a_SOURCES): Add aeabi_atexit.c.
Only build other files when providing syscalls.
* libc/sys/arm/Makefile.in: Regenerate.
* libc/sys/arm/aeabi_atexit.c: New file.
* cygtls.h (__ljfault): Declare.
(_cygtls::return_from_fault): Use __ljfault.
* exceptions.cc (set_signal_mask): Revert previous checkin.
* gendef (__sjfault): Split out into a separate function which doesn't bother
with any special signal locking. routines.
(_ljfault): Return from a __sjfault without bothering with signals.
2005-08-26 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
* Makefile.in: Remove extra anchor to make NN4 happy.
* faq.xml: Link to cygwin.com/license.html
* faq-resources.xml: Link instead of duplicating info.
* faq-using.xml: Split out services and network shares FAQ.
* faq-what.xml: Link to cygwin.com/license.html
Corinna Vinschen [Fri, 26 Aug 2005 15:11:06 +0000 (15:11 +0000)]
* path.cc (normalize_posix_path): Keep two leading slashes
intact throughout.
(normalize_win32_path): Revert to only checking for slash.
(realpath): Convert drive letters to cygdrive paths before
doing anything else.
* shared_info.h (mount_info::cygdrive_posix_path): Make public.
Corinna Vinschen [Thu, 25 Aug 2005 21:18:26 +0000 (21:18 +0000)]
* path.cc (realpath): Drop call to mount_info::conv_to_posix_path
in favor of calling path_conv with PC_POSIX flag. Align error
handling closer to POSIX. As on Linux, return user space allocated
memory if second parameter is NULL.
Corinna Vinschen [Thu, 25 Aug 2005 20:35:25 +0000 (20:35 +0000)]
* path.cc (normalize_win32_path): Honor network paths. Fold more
than two leading dir separators into one. Check for dir separator
instead of just slashes to handle incoming Win32 paths correctly.
* exceptions.cc (handle_sigsuspend): Just sleep forever if called from non-main
thread.
(sigpacket:process): Simplify logic which determines when and how a signal is
masked. Don't trigger sigwait if there is a signal handler.
* sigproc.cc (wait_sig): Update comment. Try to process a signal which is in
the queue if it isn't queued for the target thread (this is still not right).
* spawn.cc (perhaps_suffix): Record errno-type error value in third argument.
(find_exec): On error, set errno returned from perhaps_suffix.
(spawn_guts): Ditto.
* fhandler_virtual.cc (fhandler_virtual::close): Don't free filebuf if it's
NULL.
* pinfo.cc (_pinfo::commune_send): Fix test for incorrect number of bytes read
from pipe.
* path.cc (path_conv::check): Fill in fileattr for /dev, defaulting to
directory if /dev doesn't actually exist.
(win32_device_name): Don't consider FH_DEV to be a device since it's really a
directory which should go through mount processing.
* cygheap.h (cygheap_types): Add HEAP_COMMUNE.
* fhandler_proc.cc: Use cygheap rather than user heap for allocation of filebuf
throughout.
* fhandler_registry.cc: Ditto.
* fhandler_virtual.cc: Ditto.
* fhandler_process.cc: Ditto.
(get_mem_values): Use malloc/realloc/free rather than new.
* pinfo.cc (_pinfo::commune_send): Allocate on cygwin heap rather than user
heap. Avoid calling ReadFile when correct number of characters have been read
or suffer buffer corruption.
(_pinfo::fd): Allocate on cygwin heap rather than user heap.
(_pinfo::fds): Ditto.
(_pinfo::root): Ditto.
(_pinfo::cwd): Ditto.
(_pinfo::cmdline): Ditto.
* devices.h (FH_DEV): New define.
* devices.in: Detect lone /dev.
* devices.cc: Regenerate.
* path.cc (path_conv::check): Treat FH_DEV as a special case.
* sigproc.h (set_signal_mask): Remove default on second parameter and make pass
by reference.
* signal.cc (abort): Accommodate change to set_signal_mask.
* select.cc (pselect): Ditto.
* exceptions.cc (handle_sigsuspend): Ditto.
(ctrl_c_handler): Ditto.
(sighold): Ditto.
(sigrelse): Ditto.
(set_process_mask_delta): Ditto.
(_cygtls::call_signal_handler): Ditto.
* fhandler_disk_file.cc (fhandler_disk_file::readdir): Return ENMFILE if
__handle is not set. Set __handle to NULL when out of files.
(fhandler_disk_file::rewinddir): Don't close handle if it's NULL.
(fhandler_disk_file::closedir): Ditto.
* dir.cc (readdir_worker): Make static. Only add '.' and '..' when readdir
fails due to ENMFILE.
* fhandler_disk_file.cc (fhandler_disk_file::readdir): Only close handle on
error != ENMFILE.
Jeff Johnston [Mon, 22 Aug 2005 21:13:35 +0000 (21:13 +0000)]
2005-08-22 Shaun Jackman <sjackman@gmail.com>
* libc/include/_syslist.h: If HAVE_OPENDIR is not defined,
define _opendir as opendir, _readdir as readdir, and
_closedir as closedir so that the implementations in
libc/posix will be used.
* fhandler.h (dirent_states): Add dirent_saw_proc.
* fhandler_disk_file.cc (fhandler_disk_file::readdir): Fill in "proc" if it is
the root dir and it is missing.
* fhandler.h (dirent_states): Add dirent_isroot, dirent_saw_cygdrive,
dirent_saw_dev.
* dir.cc (opendir): Don't zero __flags here. Push that responsibility to
opendir methods.
(seekdir): Preserve dirent_isrrot in __flags.
(rewinddir): Ditto.
* fhandler_disk_file.cc (fhandler_disk_file::opendir): Set dirent_isroot
appropriately.
(fhandler_disk_file::readdir): Fill in "cygdrive" and "dev" if it is the root
dir and they are missing.
* fhandler_process.cc (fhandler_process::opendir): Set __flags here.
* fhandler_virtual.cc (fhandler_virtual::opendir): Set __flags here.
Corinna Vinschen [Thu, 18 Aug 2005 20:25:43 +0000 (20:25 +0000)]
* passwd.c (longopts): Add --logonserver option.
(opts): Add -d option.
(GetPW): Add server parameter which is given to Net functions.
(ChangePW): Ditto.
(PrintPW): Ditto.
(SetModals): Ditto.
(usage): Add description for -d/--logonserver option.
(main): Add option handling for -d/--logonserver. Use LOGONSERVER
environment variable content for server to contact, unless
-d/--logonserver option is given. If both is missing, use NULL.
* fhandler.h (fhandler_tty_common::lseek): Declare new method.
(fhandler_tty_slave::lseek): Delete old method.
(fhandler_tty_master::lseek): Delete old method.
* fhandler_tty.cc (fhandler_tty_common::lseek): Define new method.
* dcrt0.cc (dll_crt0_1): Tweak debugging stuff.
* fhandler_tty.cc (fhandler_tty_common::close): Rearrange the code so that the
master end of the input and output pipes is closed before signalling an EOF
event to the slave.
(fhandler_pty_master::close): Likewise.
Corinna Vinschen [Sun, 14 Aug 2005 19:48:07 +0000 (19:48 +0000)]
* init.cc (respawn_wow64_process): Make inline function. Remove
"noreturn" attribute. Add additional check if parent process is
actually a 64 bit process.
(dll_entry): Only test WOW64 processes with a stack in the usual
"dangerous" process space area.
Paolo Bonzini [Fri, 12 Aug 2005 14:22:33 +0000 (14:22 +0000)]
toplevel:
2005-08-12 Paolo Bonzini <bonzini@gnu.org>
* configure.in: Replace NCN_STRICT_CHECK_TOOL with
NCN_STRICT_CHECK_TOOLS, and likewise for NCN_STRICT_CHECK_TARGET_TOOLS.
Look for alternate names of the target cc and c++
config:
2005-08-12 Paolo Bonzini <bonzini@gnu.org>
Danny Smith [Fri, 12 Aug 2005 09:16:18 +0000 (09:16 +0000)]
* include/ddk/hidsdi.h: New file.
* lib/ddk/hid.def: Uncomment symbols and add stdcall suffix for
functions declared in hidsdi.h.
Thanks to: Alex J Lennon <ajlennon at organixconsulting dot com>
* child_info. (CURR_CHILD_INFO_MAGIC): Refresh.
(child_info::child_info()): New constructor.
(child_info_spawn::child_info_spawn()): Ditto.
(child_info_spawn::operator new): New operator.
(child_info_spawn::set): New function.
* spawn.cc (av()): New constructor.
(av::operator new): New operator.
(av::set): New function.
(spawn_guts): Reorganize so that classes which allocates are defined early in
the function so that it can be properly cleaned up after an efault. Set errno
to E2BIG in the event of a SEGV situation.